123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- #ifndef APR_ALLOCATOR_H
- #define APR_ALLOCATOR_H
- #include "apr.h"
- #include "apr_errno.h"
- #define APR_WANT_MEMFUNC
- #include "apr_want.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef struct apr_allocator_t apr_allocator_t;
- typedef struct apr_memnode_t apr_memnode_t;
- struct apr_memnode_t {
- apr_memnode_t *next;
- apr_memnode_t **ref;
- apr_uint32_t index;
- apr_uint32_t free_index;
- char *first_avail;
- char *endp;
- };
- #define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t))
- #define APR_ALLOCATOR_MAX_FREE_UNLIMITED 0
- APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator)
- __attribute__((nonnull(1)));
- APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator)
- __attribute__((nonnull(1)));
- APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator,
- apr_size_t size)
- __attribute__((nonnull(1)));
- APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator,
- apr_memnode_t *memnode)
- __attribute__((nonnull(1,2)));
-
- APR_DECLARE(apr_size_t) apr_allocator_align(apr_allocator_t *allocator,
- apr_size_t size);
- #include "apr_pools.h"
- APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator,
- apr_pool_t *pool)
- __attribute__((nonnull(1)));
- APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator)
- __attribute__((nonnull(1)));
- APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator,
- apr_size_t size)
- __attribute__((nonnull(1)));
- #include "apr_thread_mutex.h"
- #if APR_HAS_THREADS
- APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator,
- apr_thread_mutex_t *mutex)
- __attribute__((nonnull(1)));
- APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get(
- apr_allocator_t *allocator)
- __attribute__((nonnull(1)));
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
|