Apache HTTPD
Typedefs | Functions | Variables
Relocatable Memory Management Routines

Typedefs

typedef struct apr_rmm_t apr_rmm_t
 
typedef apr_size_t apr_rmm_off_t
 

Functions

 APU_DECLARE (apr_status_t) apr_rmm_init(apr_rmm_t **rmm
 
 APU_DECLARE (apr_rmm_off_t) apr_rmm_malloc(apr_rmm_t *rmm
 
 APU_DECLARE (void *) apr_rmm_addr_get(apr_rmm_t *rmm
 

Variables

apr_anylock_tlock
 
apr_anylock_t void * membuf
 
apr_anylock_t void apr_size_t memsize
 
apr_anylock_t void apr_size_t apr_pool_tcont
 
apr_size_t reqsize
 
void * entity
 

Detailed Description

Typedef Documentation

◆ apr_rmm_off_t

Fundamental allocation unit, within a specific apr_rmm_t

Definition at line 43 of file apr_rmm.h.

◆ apr_rmm_t

Structure to access Relocatable, Managed Memory

Definition at line 40 of file apr_rmm.h.

Function Documentation

◆ APU_DECLARE() [1/3]

APU_DECLARE ( apr_rmm_off_t  )

Allocate memory from the block of relocatable memory.

Parameters
rmmThe relocatable memory block
reqsizeHow much memory to allocate

Realloc memory from the block of relocatable memory.

Parameters
rmmThe relocatable memory block
entityThe memory allocation to realloc
reqsizeThe new size

Allocate memory from the block of relocatable memory and initialize it to zero.

Parameters
rmmThe relocatable memory block
reqsizeHow much memory to allocate

Compute the offset of a relocatable allocation of memory

Parameters
rmmThe relocatable memory block
entityThe physical address to convert to an offset

Compute the required overallocation of memory needed to fit n allocs

Parameters
nThe number of alloc/calloc regions desired

Definition at line 330 of file apr_rmm.c.

◆ APU_DECLARE() [2/3]

APU_DECLARE ( apr_status_t  )

Initialize a relocatable memory block to be managed by the apr_rmm API.

Parameters
rmmThe relocatable memory block
lockAn apr_anylock_t of the appropriate type of lock, or NULL if no locking is required.
membufThe block of relocatable memory to be managed
memsizeThe size of relocatable memory block to be managed
contThe pool to use for local storage and management
Remarks
Both
Parameters
membufand
memsizemust be aligned (for instance using APR_ALIGN_DEFAULT).

Destroy a managed memory block.

Parameters
rmmThe relocatable memory block to destroy

Attach to a relocatable memory block already managed by the apr_rmm API.

Parameters
rmmThe relocatable memory block
lockAn apr_anylock_t of the appropriate type of lock
membufThe block of relocatable memory already under management
contThe pool to use for local storage and management

Detach from the managed block of memory.

Parameters
rmmThe relocatable memory block to detach from

Free allocation returned by apr_rmm_malloc or apr_rmm_calloc.

Parameters
rmmThe relocatable memory block
entityThe memory allocation to free

< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.

< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.

< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".

< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".

< Replace

< Insert with duplicates

< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.

< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.

< mask to extract lock type

< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.

< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".

< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".

< Size of the file

< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock.

< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock".

Definition at line 358 of file apr_brigade.c.

◆ APU_DECLARE() [3/3]

APU_DECLARE ( void *  )

Retrieve the physical address of a relocatable allocation of memory

Parameters
rmmThe relocatable memory block
entityThe memory allocation to free
Returns
address The address, aligned with APR_ALIGN_DEFAULT.

Variable Documentation

◆ cont

Definition at line 58 of file apr_rmm.h.

◆ entity

void * entity

Definition at line 95 of file apr_rmm.h.

◆ lock

apr_anylock_t * lock

Definition at line 56 of file apr_rmm.h.

◆ membuf

apr_anylock_t void * membuf

Definition at line 57 of file apr_rmm.h.

◆ memsize

apr_anylock_t void apr_size_t memsize

Definition at line 57 of file apr_rmm.h.

◆ reqsize

apr_size_t reqsize

Definition at line 87 of file apr_rmm.h.