xref: /unit/src/nxt_mem_zone.h (revision 0:a63ceefd6ab0)
1 
2 /*
3  * Copyright (C) Igor Sysoev
4  * Copyright (C) NGINX, Inc.
5  */
6 
7 #ifndef _NXT_MEM_ZONE_H_INCLUDED_
8 #define _NXT_MEM_ZONE_H_INCLUDED_
9 
10 
11 typedef struct nxt_mem_zone_s  nxt_mem_zone_t;
12 
13 
14 NXT_EXPORT nxt_mem_zone_t *nxt_mem_zone_init(u_char *start, size_t zone_size,
15     nxt_uint_t page_size);
16 
17 #define                                                                       \
18 nxt_mem_zone_alloc(zone, size)                                                \
19     nxt_mem_zone_align((zone), 1, (size))
20 
21 NXT_EXPORT void *nxt_mem_zone_align(nxt_mem_zone_t *zone, size_t alignment,
22     size_t size)
23     NXT_MALLOC_LIKE;
24 NXT_EXPORT void *nxt_mem_zone_zalloc(nxt_mem_zone_t *zone, size_t size)
25     NXT_MALLOC_LIKE;
26 NXT_EXPORT void nxt_mem_zone_free(nxt_mem_zone_t *zone, void *p);
27 
28 
29 #endif /* _NXT_MEM_ZONE_H_INCLUDED_ */
30