nxt_mem_zone.h (0:a63ceefd6ab0) nxt_mem_zone.h (2084:7d479274f334)
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
11typedef struct nxt_mem_zone_s nxt_mem_zone_t;
12
13
14NXT_EXPORT nxt_mem_zone_t *nxt_mem_zone_init(u_char *start, size_t zone_size,
15 nxt_uint_t page_size);
16
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
11typedef struct nxt_mem_zone_s nxt_mem_zone_t;
12
13
14NXT_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 \
18nxt_mem_zone_alloc(zone, size) \
17#define nxt_mem_zone_alloc(zone, size) \
19 nxt_mem_zone_align((zone), 1, (size))
20
21NXT_EXPORT void *nxt_mem_zone_align(nxt_mem_zone_t *zone, size_t alignment,
22 size_t size)
23 NXT_MALLOC_LIKE;
24NXT_EXPORT void *nxt_mem_zone_zalloc(nxt_mem_zone_t *zone, size_t size)
25 NXT_MALLOC_LIKE;
26NXT_EXPORT void nxt_mem_zone_free(nxt_mem_zone_t *zone, void *p);
27
28
29#endif /* _NXT_MEM_ZONE_H_INCLUDED_ */
18 nxt_mem_zone_align((zone), 1, (size))
19
20NXT_EXPORT void *nxt_mem_zone_align(nxt_mem_zone_t *zone, size_t alignment,
21 size_t size)
22 NXT_MALLOC_LIKE;
23NXT_EXPORT void *nxt_mem_zone_zalloc(nxt_mem_zone_t *zone, size_t size)
24 NXT_MALLOC_LIKE;
25NXT_EXPORT void nxt_mem_zone_free(nxt_mem_zone_t *zone, void *p);
26
27
28#endif /* _NXT_MEM_ZONE_H_INCLUDED_ */