Apache HTTPD
Classes | Macros | Typedefs | Functions | Variables
apr_pools.c File Reference
#include "apr.h"
#include "apr_private.h"
#include "apr_atomic.h"
#include "apr_portable.h"
#include "apr_strings.h"
#include "apr_general.h"
#include "apr_pools.h"
#include "apr_allocator.h"
#include "apr_lib.h"
#include "apr_thread_mutex.h"
#include "apr_hash.h"
#include "apr_time.h"
#include "apr_support.h"
#include "apr_want.h"
#include "apr_env.h"

Go to the source code of this file.

Classes

struct  apr_allocator_t
 
struct  process_chain
 
struct  apr_pool_t
 
struct  psprintf_data
 
struct  cleanup_t
 

Macros

#define APR_WANT_MEMFUNC
 
#define APR_IF_VALGRIND(x)
 
#define APR_VALGRIND_NOACCESS(addr_, size_)    APR_IF_VALGRIND(VALGRIND_MAKE_MEM_NOACCESS(addr_, size_))
 
#define APR_VALGRIND_UNDEFINED(addr_, size_)    APR_IF_VALGRIND(VALGRIND_MAKE_MEM_UNDEFINED(addr_, size_))
 
#define MIN_ALLOC   (2 * BOUNDARY_SIZE)
 
#define MAX_INDEX   20
 
#define BOUNDARY_INDEX   12
 
#define BOUNDARY_SIZE   (1 << BOUNDARY_INDEX)
 
#define GUARDPAGE_SIZE   0
 
#define TIMEOUT_USECS   3000000
 
#define TIMEOUT_INTERVAL   46875
 
#define SIZEOF_ALLOCATOR_T   APR_ALIGN_DEFAULT(sizeof(apr_allocator_t))
 
#define APR_POOL_DEBUG_GENERAL   0x01
 
#define APR_POOL_DEBUG_VERBOSE   0x02
 
#define APR_POOL_DEBUG_LIFETIME   0x04
 
#define APR_POOL_DEBUG_OWNER   0x08
 
#define APR_POOL_DEBUG_VERBOSE_ALLOC   0x10
 
#define APR_POOL_DEBUG_VERBOSE_ALL
 
#define SIZEOF_POOL_T   APR_ALIGN_DEFAULT(sizeof(apr_pool_t))
 
#define list_insert(node, point)
 
#define list_remove(node)
 
#define node_free_space(node_)   ((apr_size_t)(node_->endp - node_->first_avail))
 
#define APR_PSPRINTF_MIN_STRINGSIZE   32
 

Typedefs

typedef struct cleanup_t cleanup_t
 

Functions

static APR_INLINE void allocator_lock (apr_allocator_t *allocator)
 
static APR_INLINE void allocator_unlock (apr_allocator_t *allocator)
 
 APR_DECLARE (apr_status_t)
 
 APR_DECLARE (void)
 
 APR_DECLARE (apr_pool_t *)
 
static APR_INLINE apr_size_t allocator_align (apr_size_t in_size)
 
 APR_DECLARE (apr_size_t)
 
static APR_INLINE apr_memnode_tallocator_alloc (apr_allocator_t *allocator, apr_size_t in_size)
 
static APR_INLINE void allocator_free (apr_allocator_t *allocator, apr_memnode_t *node)
 
 APR_DECLARE (apr_memnode_t *)
 
static void run_cleanups (cleanup_t **c)
 
static void free_proc_chain (struct process_chain *procs)
 
static APR_INLINE void pool_concurrency_init (apr_pool_t *pool)
 
static APR_INLINE void pool_concurrency_set_used (apr_pool_t *pool)
 
static APR_INLINE void pool_concurrency_set_idle (apr_pool_t *pool)
 
static APR_INLINE void pool_concurrency_set_destroyed (apr_pool_t *pool)
 
 APR_DECLARE (void *)
 
static int psprintf_flush (apr_vformatter_buff_t *vbuff)
 
 APR_DECLARE (char *)
 
 APR_DECLARE_NONSTD (char *)
 
 APR_DECLARE (apr_abortfunc_t)
 
 APR_DECLARE (apr_allocator_t *)
 
static void run_child_cleanups (cleanup_t **cref)
 
static void cleanup_pool_for_exec (apr_pool_t *p)
 
 APR_DECLARE_NONSTD (apr_status_t)
 

Variables

static apr_byte_t apr_pools_initialized = 0
 
static apr_pool_tglobal_pool = NULL
 
static apr_allocator_tglobal_allocator = NULL
 

Macro Definition Documentation

◆ APR_IF_VALGRIND

#define APR_IF_VALGRIND (   x)

Definition at line 62 of file apr_pools.c.

◆ APR_POOL_DEBUG_GENERAL

#define APR_POOL_DEBUG_GENERAL   0x01

Definition at line 515 of file apr_pools.c.

◆ APR_POOL_DEBUG_LIFETIME

#define APR_POOL_DEBUG_LIFETIME   0x04

Definition at line 517 of file apr_pools.c.

◆ APR_POOL_DEBUG_OWNER

#define APR_POOL_DEBUG_OWNER   0x08

Definition at line 518 of file apr_pools.c.

◆ APR_POOL_DEBUG_VERBOSE

#define APR_POOL_DEBUG_VERBOSE   0x02

Definition at line 516 of file apr_pools.c.

◆ APR_POOL_DEBUG_VERBOSE_ALL

#define APR_POOL_DEBUG_VERBOSE_ALL
Value:
#define APR_POOL_DEBUG_VERBOSE
Definition apr_pools.c:516
#define APR_POOL_DEBUG_VERBOSE_ALLOC
Definition apr_pools.c:519

Definition at line 521 of file apr_pools.c.

◆ APR_POOL_DEBUG_VERBOSE_ALLOC

#define APR_POOL_DEBUG_VERBOSE_ALLOC   0x10

Definition at line 519 of file apr_pools.c.

◆ APR_PSPRINTF_MIN_STRINGSIZE

#define APR_PSPRINTF_MIN_STRINGSIZE   32

Definition at line 1226 of file apr_pools.c.

◆ APR_VALGRIND_NOACCESS

#define APR_VALGRIND_NOACCESS (   addr_,
  size_ 
)     APR_IF_VALGRIND(VALGRIND_MAKE_MEM_NOACCESS(addr_, size_))

Definition at line 66 of file apr_pools.c.

◆ APR_VALGRIND_UNDEFINED

#define APR_VALGRIND_UNDEFINED (   addr_,
  size_ 
)     APR_IF_VALGRIND(VALGRIND_MAKE_MEM_UNDEFINED(addr_, size_))

Definition at line 68 of file apr_pools.c.

◆ APR_WANT_MEMFUNC

#define APR_WANT_MEMFUNC

Definition at line 31 of file apr_pools.c.

◆ BOUNDARY_INDEX

#define BOUNDARY_INDEX   12

Definition at line 94 of file apr_pools.c.

◆ BOUNDARY_SIZE

#define BOUNDARY_SIZE   (1 << BOUNDARY_INDEX)

Definition at line 95 of file apr_pools.c.

◆ GUARDPAGE_SIZE

#define GUARDPAGE_SIZE   0

Definition at line 105 of file apr_pools.c.

◆ list_insert

#define list_insert (   node,
  point 
)
Value:
do { \
node->ref = point->ref; \
*node->ref = node; \
node->next = point; \
point->ref = &node->next; \
} while (0)
apr_off_t point

Definition at line 728 of file apr_pools.c.

◆ list_remove

#define list_remove (   node)
Value:
do { \
*node->ref = node->next; \
node->next->ref = node->ref; \
} while (0)

Definition at line 736 of file apr_pools.c.

◆ MAX_INDEX

#define MAX_INDEX   20

Definition at line 86 of file apr_pools.c.

◆ MIN_ALLOC

#define MIN_ALLOC   (2 * BOUNDARY_SIZE)

Definition at line 85 of file apr_pools.c.

◆ node_free_space

#define node_free_space (   node_)    ((apr_size_t)(node_->endp - node_->first_avail))

Definition at line 742 of file apr_pools.c.

◆ SIZEOF_ALLOCATOR_T

#define SIZEOF_ALLOCATOR_T   APR_ALIGN_DEFAULT(sizeof(apr_allocator_t))

Definition at line 156 of file apr_pools.c.

◆ SIZEOF_POOL_T

#define SIZEOF_POOL_T   APR_ALIGN_DEFAULT(sizeof(apr_pool_t))

Definition at line 608 of file apr_pools.c.

◆ TIMEOUT_INTERVAL

#define TIMEOUT_INTERVAL   46875

Definition at line 116 of file apr_pools.c.

◆ TIMEOUT_USECS

#define TIMEOUT_USECS   3000000

Definition at line 115 of file apr_pools.c.

Typedef Documentation

◆ cleanup_t

Definition at line 529 of file apr_pools.c.

Function Documentation

◆ allocator_align()

static APR_INLINE apr_size_t allocator_align ( apr_size_t  in_size)
static

Definition at line 263 of file apr_pools.c.

◆ allocator_alloc()

static APR_INLINE apr_memnode_t * allocator_alloc ( apr_allocator_t allocator,
apr_size_t  in_size 
)
static

Definition at line 289 of file apr_pools.c.

◆ allocator_free()

static APR_INLINE void allocator_free ( apr_allocator_t allocator,
apr_memnode_t node 
)
static

Definition at line 426 of file apr_pools.c.

◆ allocator_lock()

static APR_INLINE void allocator_lock ( apr_allocator_t allocator)
static

Definition at line 164 of file apr_pools.c.

◆ allocator_unlock()

static APR_INLINE void allocator_unlock ( apr_allocator_t allocator)
static

Definition at line 173 of file apr_pools.c.

◆ APR_DECLARE() [1/2]

APR_DECLARE ( apr_memnode_t )

Definition at line 497 of file apr_pools.c.

◆ APR_DECLARE() [2/2]

APR_DECLARE ( char )

Definition at line 1332 of file apr_pools.c.

◆ APR_DECLARE_NONSTD()

APR_DECLARE_NONSTD ( char )

Definition at line 2351 of file apr_pools.c.

◆ cleanup_pool_for_exec()

static void cleanup_pool_for_exec ( apr_pool_t p)
static

Definition at line 2684 of file apr_pools.c.

◆ free_proc_chain()

static void free_proc_chain ( struct process_chain procs)
static

Definition at line 2740 of file apr_pools.c.

◆ pool_concurrency_init()

static APR_INLINE void pool_concurrency_init ( apr_pool_t pool)
static

Definition at line 800 of file apr_pools.c.

◆ pool_concurrency_set_destroyed()

static APR_INLINE void pool_concurrency_set_destroyed ( apr_pool_t pool)
static

Definition at line 803 of file apr_pools.c.

◆ pool_concurrency_set_idle()

static APR_INLINE void pool_concurrency_set_idle ( apr_pool_t pool)
static

Definition at line 802 of file apr_pools.c.

◆ pool_concurrency_set_used()

static APR_INLINE void pool_concurrency_set_used ( apr_pool_t pool)
static

Definition at line 801 of file apr_pools.c.

◆ psprintf_flush()

static int psprintf_flush ( apr_vformatter_buff_t vbuff)
static

Definition at line 1228 of file apr_pools.c.

◆ run_child_cleanups()

static void run_child_cleanups ( cleanup_t **  cref)
static

Definition at line 2673 of file apr_pools.c.

◆ run_cleanups()

static void run_cleanups ( cleanup_t **  c)
static

Definition at line 2660 of file apr_pools.c.

Variable Documentation

◆ apr_pools_initialized

apr_byte_t apr_pools_initialized = 0
static

Definition at line 615 of file apr_pools.c.

◆ global_allocator

apr_allocator_t* global_allocator = NULL
static

Definition at line 619 of file apr_pools.c.

◆ global_pool

apr_pool_t* global_pool = NULL
static

Definition at line 616 of file apr_pools.c.