Re: [HACKERS] new heap manager mmalloc - Mailing list pgsql-hackers

From Patrick Welche
Subject Re: [HACKERS] new heap manager mmalloc
Date
Msg-id E106c0f-000441-00@quartz.newn.cam.ac.uk
Whole thread Raw
In response to Re: [HACKERS] new heap manager mmalloc  (jwieck@debis.com (Jan Wieck))
List pgsql-hackers
Jan Wieck wrote:
> 
>     Right  right  right!  Pooled allocation will gain performance
>     and the separate bookkeeping should be more useful.

...

>     But I can think of another thing that might help. A temporary
>     allocation pool stack.
> 
>     The functions to manage it are:
> 
>         void tmppalloc_push(void);
>         void tmppalloc_pop(void);
>         void *tmppalloc(Size size);
>         void *tmpuppalloc(Size size, int levels_up);

You might be interested in:

POOL(9)                      NetBSD Kernel Manual                      POOL(9)

NAME    pool_create, pool_destroy, pool_get, pool_put, pool_prime - resource-pool    manager

...

DESCRIPTION    These utility routines provide management of pools of fixed-sized areas    of memory.  Resource pools
setaside an amount of memory for exclusive    use by the resource pool owner.  This can be used by applications to
guaranteethe availability of a minimum amount of memory needed to con�    tinue operation independent of the memory
resourcescurrently available    from the system-wide memory allocator (malloc(9)).  The pool manager can    optionally
obtaintemporary memory by calling the palloc() function    passed to pool_create(), for extra pool items in case the
numberof allo�    cations exceeds the nominal number of pool items managed by a pool re�    source.  This temporary
memorywill be automatically returned to the sys�    tem at a later time.
 

...

CODE REFERENCES    The pool manager is implemented in the file sys/kern/subr_pool.c.

eg. ftp://ftp.NetBSD.org/pub/NetBSD-current/src/sys/kern/subr_pool.c

Cheers,

Patrick


pgsql-hackers by date:

Previous
From: "Cary O'Brien"
Date:
Subject: Re: [HACKERS] Postmaster dies with many child processes
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Postmaster dies with many child processes (spinlock/semget failed)