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

From Reid Thompson
Subject Oversight in slab.c SlabContextCreate(), initial memory allocation size is not populated to context->mem_allocated
Date
Msg-id 491ebf6e1cd05adc3428db60eaac9487b6604037.camel@crunchydata.com
Whole thread Raw
Responses Re: Oversight in slab.c SlabContextCreate(), initial memory allocation size is not populated to context->mem_allocated
List 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.thompson@crunchydata.com
www.crunchydata.com



pgsql-hackers by date:

Previous
From: chap@anastigmatix.net
Date:
Subject: Re: Documentation about PL transforms
Next
From: Tom Lane
Date:
Subject: Re: generic plans and "initial" pruning