diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-12-28 16:01:06 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-12-28 16:01:06 +0300 |
commit | 497faf1b9abb188cab40c389a9e6221add5dd496 (patch) | |
tree | cb25d7f278a6706cf6f74cd25982764ca1d0c4f6 /src/nxt_mp.h | |
parent | b59535b22c73b04ed85c0bc1287203e3449c645b (diff) | |
download | unit-497faf1b9abb188cab40c389a9e6221add5dd496.tar.gz unit-497faf1b9abb188cab40c389a9e6221add5dd496.tar.bz2 |
Changed nxt_mp_retain() and nxt_mp_release() interfaces.
Diffstat (limited to 'src/nxt_mp.h')
-rw-r--r-- | src/nxt_mp.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/nxt_mp.h b/src/nxt_mp.h index 71a48de6..53d1f011 100644 --- a/src/nxt_mp.h +++ b/src/nxt_mp.h @@ -41,6 +41,17 @@ NXT_EXPORT nxt_mp_t *nxt_mp_create(size_t cluster_size, size_t page_alignment, */ NXT_EXPORT void nxt_mp_destroy(nxt_mp_t *mp); +/* + * nxt_mp_retain() increases memory pool retention counter. + */ +NXT_EXPORT void nxt_mp_retain(nxt_mp_t *mp); + +/* + * nxt_mp_release() decreases memory pool retention counter. + * If the counter becomes zero the pool is destroyed. + */ +NXT_EXPORT void nxt_mp_release(nxt_mp_t *mp); + /* nxt_mp_test_sizes() tests validity of memory pool parameters. */ NXT_EXPORT nxt_bool_t nxt_mp_test_sizes(size_t cluster_size, size_t page_alignment, size_t page_size, size_t min_chunk_size); @@ -76,20 +87,6 @@ NXT_EXPORT void *nxt_mp_zalign(nxt_mp_t *mp, size_t alignment, size_t size) NXT_EXPORT void nxt_mp_free(nxt_mp_t *mp, void *p); -/* - * nxt_mp_retain() returns aligned freeable memory and increases memory - * pool retention counter. - */ -NXT_EXPORT void *nxt_mp_retain(nxt_mp_t *mp, size_t size) - NXT_MALLOC_LIKE; - -/* - * nxt_mp_release() returns freeable memory and decreases memory pool - * retention counter. If the counter becomes zero the pool is destroyed. - */ -NXT_EXPORT uint32_t nxt_mp_release(nxt_mp_t *mp, void *p); - - /* nxt_mp_nget() returns non-aligned non-freeable memory. */ NXT_EXPORT void *nxt_mp_nget(nxt_mp_t *mp, size_t size) NXT_MALLOC_LIKE; |