GME  13
Defines | Typedefs | Functions | Variables
apr_pools.h File Reference

APR memory allocation. More...

Go to the source code of this file.

Defines

#define APR_WANT_MEMFUNC
#define APR_POOL_DECLARE_ACCESSOR(type)
#define APR_POOL_IMPLEMENT_ACCESSOR(type)
#define APR_POOL_DEBUG   0
#define APR_POOL__FILE_LINE__   __FILE__ ":" APR_STRINGIFY(__LINE__)
#define apr_pool_create(newpool, parent)   apr_pool_create_ex(newpool, parent, NULL, NULL)
#define apr_pool_create_core(newpool)   apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
#define apr_pool_create_unmanaged(newpool)   apr_pool_create_unmanaged_ex(newpool, NULL, NULL)
#define apr_pcalloc(p, size)   memset(apr_palloc(p, size), 0, size)
#define apr_pool_join(a, b)
#define apr_pool_lock(pool, lock)

Typedefs

typedef struct apr_pool_t apr_pool_t
typedef int(* apr_abortfunc_t )(int retcode)

Functions

 APR_DECLARE (apr_status_t) apr_pool_initialize(void)
 APR_DECLARE (void) apr_pool_terminate(void)
apr_pool_t apr_abortfunc_t
apr_allocator_t *allocator 
__attribute__ ((nonnull(1)))
 APR_DECLARE (apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool) __attribute__((nonnull(1)))
 APR_DECLARE (void *) apr_palloc(apr_pool_t *p
apr_pool_t *pool __attribute__ ((nonnull(2)))
 APR_DECLARE (apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool) __attribute__((nonnull(1)))
 APR_DECLARE (apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool) __attribute__((nonnull(1)))
const char apr_pool_t *pool __attribute__ ((nonnull(1, 2, 3)))
 APR_DECLARE_NONSTD (apr_status_t) apr_pool_cleanup_null(void *data)

Variables

apr_pool_tparent
apr_pool_t apr_abortfunc_t abort_fn
apr_abortfunc_t apr_allocator_tallocator
apr_abortfunc_t
apr_allocator_t const char * 
file_line
apr_size_t size
apr_pool_tb
const char * key
const char apr_status_t(* cleanup )(void *)
const char apr_status_t(*)
apr_pool_t *poo 
__attribute__ )((nonnull(2, 4)))
const void * data
const void apr_status_t(* plain_cleanup )(void *)
const void apr_status_t(*)
apr_status_t(* 
child_cleanup )(void *)) __attribute__((nonnull(3
const void apr_status_t(*)
apr_status_t(* 
APR_DECLARE )(void) apr_pool_pre_cleanup_register(apr_pool_t *p

Detailed Description

APR memory allocation.

Resource allocation routines...

designed so that we don't have to keep track of EVERYTHING so that it can be explicitly freed later (a fundamentally unsound strategy --- particularly in the presence of die()).

Instead, we maintain pools, and allocate items (both memory and I/O handlers) from the pools --- currently there are two, one for per-transaction info, and one for config info. When a transaction is over, we can delete everything in the per-transaction apr_pool_t without fear, and without thinking too hard about it either.

Note that most operations on pools are not thread-safe: a single pool should only be accessed by a single thread at any given time. The one exception to this rule is creating a subpool of a given pool: one or more threads can safely create subpools at the same time that another thread accesses the parent pool.

Definition in file apr_pools.h.


Define Documentation

for no good reason?

Definition at line 46 of file apr_pools.h.