nxt_mp.h (164:7449e4954471) nxt_mp.h (430:3a24c399394f)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#ifndef _NXT_MP_H_INCLUDED_
8#define _NXT_MP_H_INCLUDED_

--- 27 unchanged lines hidden (view full) ---

36 NXT_MALLOC_LIKE;
37
38/*
39 * nxt_mp_destroy() destroys memory pool in spite of the pool's retention
40 * counter.
41 */
42NXT_EXPORT void nxt_mp_destroy(nxt_mp_t *mp);
43
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#ifndef _NXT_MP_H_INCLUDED_
8#define _NXT_MP_H_INCLUDED_

--- 27 unchanged lines hidden (view full) ---

36 NXT_MALLOC_LIKE;
37
38/*
39 * nxt_mp_destroy() destroys memory pool in spite of the pool's retention
40 * counter.
41 */
42NXT_EXPORT void nxt_mp_destroy(nxt_mp_t *mp);
43
44/*
45 * nxt_mp_retain() increases memory pool retention counter.
46 */
47NXT_EXPORT void nxt_mp_retain(nxt_mp_t *mp);
48
49/*
50 * nxt_mp_release() decreases memory pool retention counter.
51 * If the counter becomes zero the pool is destroyed.
52 */
53NXT_EXPORT void nxt_mp_release(nxt_mp_t *mp);
54
44/* nxt_mp_test_sizes() tests validity of memory pool parameters. */
45NXT_EXPORT nxt_bool_t nxt_mp_test_sizes(size_t cluster_size,
46 size_t page_alignment, size_t page_size, size_t min_chunk_size);
47
48/* nxt_mp_is_empty() tests that pool is empty. */
49NXT_EXPORT nxt_bool_t nxt_mp_is_empty(nxt_mp_t *mp);
50
51

--- 19 unchanged lines hidden (view full) ---

71/* nxt_mp_zalign() returns zeroed aligned freeable memory. */
72NXT_EXPORT void *nxt_mp_zalign(nxt_mp_t *mp, size_t alignment, size_t size)
73 NXT_MALLOC_LIKE;
74
75/* nxt_mp_free() frees freeable memory. */
76NXT_EXPORT void nxt_mp_free(nxt_mp_t *mp, void *p);
77
78
55/* nxt_mp_test_sizes() tests validity of memory pool parameters. */
56NXT_EXPORT nxt_bool_t nxt_mp_test_sizes(size_t cluster_size,
57 size_t page_alignment, size_t page_size, size_t min_chunk_size);
58
59/* nxt_mp_is_empty() tests that pool is empty. */
60NXT_EXPORT nxt_bool_t nxt_mp_is_empty(nxt_mp_t *mp);
61
62

--- 19 unchanged lines hidden (view full) ---

82/* nxt_mp_zalign() returns zeroed aligned freeable memory. */
83NXT_EXPORT void *nxt_mp_zalign(nxt_mp_t *mp, size_t alignment, size_t size)
84 NXT_MALLOC_LIKE;
85
86/* nxt_mp_free() frees freeable memory. */
87NXT_EXPORT void nxt_mp_free(nxt_mp_t *mp, void *p);
88
89
79/*
80 * nxt_mp_retain() returns aligned freeable memory and increases memory
81 * pool retention counter.
82 */
83NXT_EXPORT void *nxt_mp_retain(nxt_mp_t *mp, size_t size)
84 NXT_MALLOC_LIKE;
85
86/*
87 * nxt_mp_release() returns freeable memory and decreases memory pool
88 * retention counter. If the counter becomes zero the pool is destroyed.
89 */
90NXT_EXPORT uint32_t nxt_mp_release(nxt_mp_t *mp, void *p);
91
92
93/* nxt_mp_nget() returns non-aligned non-freeable memory. */
94NXT_EXPORT void *nxt_mp_nget(nxt_mp_t *mp, size_t size)
95 NXT_MALLOC_LIKE;
96
97/*
98 * nxt_mp_get() returns aligned non-freeable memory.
99 * The alignment is sutiable to allocate structures.
100 */

--- 18 unchanged lines hidden ---
90/* nxt_mp_nget() returns non-aligned non-freeable memory. */
91NXT_EXPORT void *nxt_mp_nget(nxt_mp_t *mp, size_t size)
92 NXT_MALLOC_LIKE;
93
94/*
95 * nxt_mp_get() returns aligned non-freeable memory.
96 * The alignment is sutiable to allocate structures.
97 */

--- 18 unchanged lines hidden ---