Apache HTTPD
framework
httpd-2.4.62
srclib
apr
include
apr_allocator.h
Go to the documentation of this file.
1
/* Licensed to the Apache Software Foundation (ASF) under one or more
2
* contributor license agreements. See the NOTICE file distributed with
3
* this work for additional information regarding copyright ownership.
4
* The ASF licenses this file to You under the Apache License, Version 2.0
5
* (the "License"); you may not use this file except in compliance with
6
* the License. You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef APR_ALLOCATOR_H
18
#define APR_ALLOCATOR_H
19
25
#include "apr.h"
26
#include "
apr_errno.h
"
27
#define APR_WANT_MEMFUNC
28
#include "
apr_want.h
"
29
30
#ifdef __cplusplus
31
extern
"C"
{
32
#endif
33
41
typedef
struct
apr_allocator_t
apr_allocator_t
;
43
typedef
struct
apr_memnode_t
apr_memnode_t
;
44
54
struct
apr_memnode_t
{
55
apr_memnode_t
*
next
;
56
apr_memnode_t
**
ref
;
57
apr_uint32_t
index
;
58
apr_uint32_t
free_index
;
59
char
*
first_avail
;
60
char
*
endp
;
61
};
62
64
#define APR_MEMNODE_T_SIZE APR_ALIGN_DEFAULT(sizeof(apr_memnode_t))
65
67
#define APR_ALLOCATOR_MAX_FREE_UNLIMITED 0
68
74
APR_DECLARE
(
apr_status_t
)
apr_allocator_create
(
apr_allocator_t
**
allocator
)
75
__attribute__
((
nonnull
(1)));
76
83
APR_DECLARE
(
void
)
apr_allocator_destroy
(
apr_allocator_t
*
allocator
)
84
__attribute__
((
nonnull
(1)));
85
92
APR_DECLARE
(
apr_memnode_t
*)
apr_allocator_alloc
(
apr_allocator_t
*
allocator
,
93
apr_size_t
size
)
94
__attribute__
((
nonnull
(1)));
95
103
APR_DECLARE
(
void
)
apr_allocator_free
(
apr_allocator_t
*
allocator
,
104
apr_memnode_t
*memnode)
105
__attribute__
((
nonnull
(1,2)));
106
114
APR_DECLARE
(
apr_size_t
)
apr_allocator_align
(
apr_allocator_t
*
allocator
,
115
apr_size_t
size
);
116
117
#include "apr_pools.h"
118
125
/*
126
* XXX: see if we can come up with something a bit better. Currently
127
* you can make a pool an owner, but if the pool doesn't use the allocator
128
* the allocator will never be destroyed.
129
*/
130
APR_DECLARE
(
void
)
apr_allocator_owner_set
(
apr_allocator_t
*
allocator
,
131
apr_pool_t
*
pool
)
132
__attribute__
((
nonnull
(1)));
133
138
APR_DECLARE
(
apr_pool_t
*)
apr_allocator_owner_get
(
apr_allocator_t
*
allocator
)
139
__attribute__
((
nonnull
(1)));
140
147
APR_DECLARE
(
void
)
apr_allocator_max_free_set
(
apr_allocator_t
*
allocator
,
148
apr_size_t
size
)
149
__attribute__
((
nonnull
(1)));
150
151
#include "
apr_thread_mutex.h
"
152
153
#if APR_HAS_THREADS
159
APR_DECLARE
(
void
)
apr_allocator_mutex_set
(
apr_allocator_t
*
allocator
,
160
apr_thread_mutex_t
*mutex)
161
__attribute__
((
nonnull
(1)));
162
167
APR_DECLARE
(
apr_thread_mutex_t
*)
apr_allocator_mutex_get
(
168
apr_allocator_t
*
allocator
)
169
__attribute__
((
nonnull
(1)));
170
171
#endif
/* APR_HAS_THREADS */
172
175
#ifdef __cplusplus
176
}
177
#endif
178
179
#endif
/* !APR_ALLOCATOR_H */
apr_errno.h
APR Error Codes.
apr_thread_mutex.h
APR Thread Mutex Routines.
apr_want.h
APR Standard Headers Support.
size
apr_size_t size
Definition
apr_allocator.h:115
APR_DECLARE
APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator) __attribute__((nonnull(1)))
Definition
apr_pools.h:646
pool
const char int apr_pool_t * pool
Definition
apr_cstr.h:84
apr_status_t
int apr_status_t
Definition
apr_errno.h:44
allocator
apr_abortfunc_t apr_allocator_t * allocator
Definition
apr_pools.h:208
__attribute__
const char apr_status_t(*) apr_pool_t *poo __attribute__)((nonnull(2, 4)))
Definition
apr_pools.h:567
apr_allocator_t
Definition
apr_pools.c:125
apr_memnode_t
Definition
apr_allocator.h:54
apr_memnode_t::next
apr_memnode_t * next
Definition
apr_allocator.h:55
apr_memnode_t::endp
char * endp
Definition
apr_allocator.h:60
apr_memnode_t::index
apr_uint32_t index
Definition
apr_allocator.h:57
apr_memnode_t::first_avail
char * first_avail
Definition
apr_allocator.h:59
apr_memnode_t::ref
apr_memnode_t ** ref
Definition
apr_allocator.h:56
apr_memnode_t::free_index
apr_uint32_t free_index
Definition
apr_allocator.h:58
apr_pool_t
Definition
apr_pools.c:562
apr_thread_mutex_t
Definition
apr_arch_thread_mutex.h:28
Generated by
1.9.8