Oversight in slab.c SlabContextCreate(), initial memory allocation size is not populated to context->mem_allocated

From: Reid Thompson <reid(dot)thompson(at)crunchydata(dot)com>
To: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: reid(dot)thompson(at)crunchydata(dot)com
Subject: Oversight in slab.c SlabContextCreate(), initial memory allocation size is not populated to context->mem_allocated
Date: 2022-07-29 16:43:45
Message-ID: 491ebf6e1cd05adc3428db60eaac9487b6604037.camel@crunchydata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Both aset.c and generation.c populate mem_allocated in
AllocSetContextCreateInternal(), GenerationContextCreate()
respectively.
aset.c
/* Finally, do the type-independent part of context creation */
MemoryContextCreate((MemoryContext) set,
T_AllocSetContext,
&AllocSetMethods,
parent,
name);

((MemoryContext) set)->mem_allocated = firstBlockSize;

return (MemoryContext) set;
}

generation.c
/* Finally, do the type-independent part of context creation */
MemoryContextCreate((MemoryContext) set,
T_GenerationContext,
&GenerationMethods,
parent,
name);

((MemoryContext) set)->mem_allocated = firstBlockSize;

return (MemoryContext) set;
}

slab.c
does not in SlabContextCreate(). Is this intentional, it seems to be an
oversight to me.

/* Finally, do the type-independent part of context creation */
MemoryContextCreate((MemoryContext) slab,
T_SlabContext,
&SlabMethods,
parent,
name);

return (MemoryContext) slab;
}
--
Reid Thompson
Senior Software Engineer
Crunchy Data, Inc.

reid(dot)thompson(at)crunchydata(dot)com
www.crunchydata.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-07-29 16:47:05 Re: generic plans and "initial" pruning
Previous Message chap 2022-07-29 16:35:20 Re: Documentation about PL transforms