Functions

Pool Cleanup Functions
[Memory Pool Functions]

Functions

void apr_pool_cleanup_register (apr_pool_t *p, const void *data, apr_status_t(*plain_cleanup)(void *), apr_status_t(*child_cleanup)(void *))
void apr_pool_pre_cleanup_register (apr_pool_t *p, const void *data, apr_status_t(*plain_cleanup)(void *))
void apr_pool_cleanup_kill (apr_pool_t *p, const void *data, apr_status_t(*cleanup)(void *))
void apr_pool_child_cleanup_set (apr_pool_t *p, const void *data, apr_status_t(*plain_cleanup)(void *), apr_status_t(*child_cleanup)(void *))
apr_status_t apr_pool_cleanup_run (apr_pool_t *p, void *data, apr_status_t(*cleanup)(void *))
apr_status_t apr_pool_cleanup_null (void *data)
void apr_pool_cleanup_for_exec (void)

Detailed Description

Cleanups are performed in the reverse order they were registered. That is: Last In, First Out. A cleanup function can safely allocate memory from the pool that is being cleaned up. It can also safely register additional cleanups which will be run LIFO, directly after the current cleanup terminates. Cleanups have to take caution in calling functions that create subpools. Subpools, created during cleanup will NOT automatically be cleaned up. In other words, cleanups are to clean up after themselves.


Function Documentation

void apr_pool_child_cleanup_set ( apr_pool_t p,
const void *  data,
apr_status_t(*)(void *)  plain_cleanup,
apr_status_t(*)(void *)  child_cleanup 
)

Replace the child cleanup function of a previously registered cleanup.

The cleanup most recently registered with p having the same values of data and plain_cleanup will have the registered child cleanup function replaced with child_cleanup.

Parameters:
p The pool of the registered cleanup
data The data of the registered cleanup
plain_cleanup The plain cleanup function of the registered cleanup
child_cleanup The function to register as the child cleanup
void apr_pool_cleanup_for_exec ( void   ) 

Run all registered child cleanups, in preparation for an exec() call in a forked child -- close files, etc., but *don't* flush I/O buffers, *don't* wait for subprocesses, and *don't* free any memory.

void apr_pool_cleanup_kill ( apr_pool_t p,
const void *  data,
apr_status_t(*)(void *)  cleanup 
)

Remove a previously registered cleanup function.

The cleanup most recently registered with p having the same values of data and cleanup will be removed.

Parameters:
p The pool to remove the cleanup from
data The data of the registered cleanup
cleanup The function to remove from fb">apr_pool_t *p, const void *data, apr_status_t(*plain_cleanup)(void *))
void apr_pool_cleanup_kill (apr_pool_t *p, const void *data, apr_status_t(*cleanup)(void *))
void apr_pool_child_cleanup_set (apr_pool_t *p, const void *data, apr_status_t(*plain_cleanup)(void *), apr_status_t(*child_cleanup)(void *))
apr_status_t apr_pool_cleanup_run (apr_pool_t *p, void *data, apr_status_t(*cleanup)(void *))
apr_status_t apr_pool_cleanup_null (void *data)
void apr_pool_cleanup_for_exec (void)

Detailed Description

Cleanups are performed in the reverse order they were registered. That is: Last In, First Out. A cleanup function can safely allocate memory from the pool that is being cleaned up. It can also safely register additional cleanups which will be run LIFO, directly after the current cleanup terminates. Cleanups have to take caution in calling functions that create subpools. Subpools, created during cleanup will NOT automatically be cleaned up. In other words, cleanups are to clean up after themselves.


Function Documentation

void apr_pool_child_cleanup_set ( apr_pool_t p,
const void *  data,
apr_status_t(*)(void *)  plain_cleanup,
apr_status_t(*)(void *)  child_cleanup 
)

Replace the child cleanup function of a previously registered cleanup.

The cleanup most recently registered with p having the same values of data and plain_cleanup will have the registered child cleanup function replaced with child_cleanup.

Parameters:
p The pool of the registered cleanup
data The data of the registered cleanup
plain_cleanup The plain cleanup function of the registered cleanup
child_cleanup The function to register as the child cleanup
void apr_pool_cleanup_for_exec ( void   ) 

Run all registered child cleanups, in preparation for an exec() call in a forked child -- close files, etc., but *don't* flush I/O buffers, *don't* wait for subprocesses, and *don't* free any memory.

void apr_pool_cleanup_kill ( apr_pool_t p,
const void *  data,
apr_status_t(*)(void *)  cleanup 
)

Remove a previously registered cleanup function.

The cleanup most recently registered with p having the same values of data and cleanup will be removed.

Parameters:
p The pool to remove the cleanup from
data The data of the registered cleanup
cleanup The function to remove from fb">apr_pool_t *p, const void *data, apr_status_t(*plain_cleanup)(void *))
void apr_pool_cleanup_kill (apr_pool_t *p, const void *data, apr_status_t(*cleanup)(void *))
void apr_pool_child_cleanup_set (apr_pool_t *p, const void *data, apr_status_t(*plain_cleanup)(void *), apr_status_t(*child_cleanup)(void *))
apr_status_t apr_pool_cleanup_run (apr_pool_t *p, void *data, apr_st