summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_buf.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-06-20 19:49:17 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-06-20 19:49:17 +0300
commitf888a5310c1808902b4035ca3454b62bc5cf4434 (patch)
tree7425e11cdba27420d21468b0f79787834bd3c498 /src/nxt_buf.c
parentc7ab908c19242a5ddd0233e123e8c2be210b3c02 (diff)
downloadunit-f888a5310c1808902b4035ca3454b62bc5cf4434.tar.gz
unit-f888a5310c1808902b4035ca3454b62bc5cf4434.tar.bz2
Using new memory pool implementation.
Diffstat (limited to 'src/nxt_buf.c')
-rw-r--r--src/nxt_buf.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/nxt_buf.c b/src/nxt_buf.c
index cee1392e..e07326ef 100644
--- a/src/nxt_buf.c
+++ b/src/nxt_buf.c
@@ -23,11 +23,11 @@ nxt_buf_mem_init(nxt_buf_t *b, void *start, size_t size)
nxt_buf_t *
-nxt_buf_mem_alloc(nxt_mem_pool_t *mp, size_t size, nxt_uint_t flags)
+nxt_buf_mem_alloc(nxt_mp_t *mp, size_t size, nxt_uint_t flags)
{
nxt_buf_t *b;
- b = nxt_mem_cache_zalloc0(mp, NXT_BUF_MEM_SIZE);
+ b = nxt_mp_zalloc(mp, NXT_BUF_MEM_SIZE);
if (nxt_slow_path(b == NULL)) {
return NULL;
}
@@ -37,7 +37,7 @@ nxt_buf_mem_alloc(nxt_mem_pool_t *mp, size_t size, nxt_uint_t flags)
b->size = NXT_BUF_MEM_SIZE;
if (size != 0) {
- b->mem.start = nxt_mem_buf(mp, &size, flags);
+ b->mem.start = nxt_mp_alloc(mp, size);
if (nxt_slow_path(b->mem.start == NULL)) {
return NULL;
}
@@ -52,11 +52,11 @@ nxt_buf_mem_alloc(nxt_mem_pool_t *mp, size_t size, nxt_uint_t flags)
nxt_buf_t *
-nxt_buf_file_alloc(nxt_mem_pool_t *mp, size_t size, nxt_uint_t flags)
+nxt_buf_file_alloc(nxt_mp_t *mp, size_t size, nxt_uint_t flags)
{
nxt_buf_t *b;
- b = nxt_mem_cache_zalloc0(mp, NXT_BUF_FILE_SIZE);
+ b = nxt_mp_zalloc(mp, NXT_BUF_FILE_SIZE);
if (nxt_slow_path(b == NULL)) {
return NULL;
}
@@ -67,7 +67,7 @@ nxt_buf_file_alloc(nxt_mem_pool_t *mp, size_t size, nxt_uint_t flags)
nxt_buf_set_file(b);
if (size != 0) {
- b->mem.start = nxt_mem_buf(mp, &size, flags);
+ b->mem.start = nxt_mp_alloc(mp, size);
if (nxt_slow_path(b->mem.start == NULL)) {
return NULL;
}
@@ -82,11 +82,11 @@ nxt_buf_file_alloc(nxt_mem_pool_t *mp, size_t size, nxt_uint_t flags)
nxt_buf_t *
-nxt_buf_mmap_alloc(nxt_mem_pool_t *mp, size_t size)
+nxt_buf_mmap_alloc(nxt_mp_t *mp, size_t size)
{
nxt_buf_t *b;
- b = nxt_mem_cache_zalloc0(mp, NXT_BUF_MMAP_SIZE);
+ b = nxt_mp_zalloc(mp, NXT_BUF_MMAP_SIZE);
if (nxt_fast_path(b != NULL)) {
b->data = mp;
@@ -103,11 +103,11 @@ nxt_buf_mmap_alloc(nxt_mem_pool_t *mp, size_t size)
nxt_buf_t *
-nxt_buf_sync_alloc(nxt_mem_pool_t *mp, nxt_uint_t flags)
+nxt_buf_sync_alloc(nxt_mp_t *mp, nxt_uint_t flags)
{
nxt_buf_t *b;
- b = nxt_mem_cache_zalloc0(mp, NXT_BUF_SYNC_SIZE);
+ b = nxt_mp_zalloc(mp, NXT_BUF_SYNC_SIZE);
if (nxt_fast_path(b != NULL)) {
b->data = mp;
@@ -158,8 +158,8 @@ nxt_buf_chain_length(nxt_buf_t *b)
static void
nxt_buf_completion(nxt_task_t *task, void *obj, void *data)
{
- nxt_buf_t *b, *parent;
- nxt_mem_pool_t *mp;
+ nxt_mp_t *mp;
+ nxt_buf_t *b, *parent;
b = obj;
parent = data;