diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-06-20 19:49:17 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-06-20 19:49:17 +0300 |
commit | f888a5310c1808902b4035ca3454b62bc5cf4434 (patch) | |
tree | 7425e11cdba27420d21468b0f79787834bd3c498 /src/nxt_job.c | |
parent | c7ab908c19242a5ddd0233e123e8c2be210b3c02 (diff) | |
download | unit-f888a5310c1808902b4035ca3454b62bc5cf4434.tar.gz unit-f888a5310c1808902b4035ca3454b62bc5cf4434.tar.bz2 |
Using new memory pool implementation.
Diffstat (limited to 'src/nxt_job.c')
-rw-r--r-- | src/nxt_job.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/nxt_job.c b/src/nxt_job.c index 68ced550..1e08cc26 100644 --- a/src/nxt_job.c +++ b/src/nxt_job.c @@ -15,23 +15,22 @@ static void nxt_job_thread_return_handler(nxt_task_t *task, void *obj, void * -nxt_job_create(nxt_mem_pool_t *mp, size_t size) +nxt_job_create(nxt_mp_t *mp, size_t size) { size_t cache_size; nxt_job_t *job; if (mp == NULL) { - mp = nxt_mem_pool_create(256); - + mp = nxt_mp_create(1024, 128, 256, 32); if (nxt_slow_path(mp == NULL)) { return NULL; } - job = nxt_mem_zalloc(mp, size); + job = nxt_mp_zget(mp, size); cache_size = 0; } else { - job = nxt_mem_cache_zalloc0(mp, size); + job = nxt_mp_zalloc(mp, size); cache_size = size; } @@ -71,17 +70,19 @@ nxt_job_destroy(nxt_task_t *task, void *data) if (job->cache_size == 0) { if (job->mem_pool != NULL) { - nxt_mem_pool_destroy(job->mem_pool); + nxt_mp_destroy(job->mem_pool); } } else { - nxt_mem_cache_free0(job->mem_pool, job, job->cache_size); + nxt_mp_free(job->mem_pool, job); } } +#if 0 + nxt_int_t -nxt_job_cleanup_add(nxt_mem_pool_t *mp, nxt_job_t *job) +nxt_job_cleanup_add(nxt_mp_t *mp, nxt_job_t *job) { nxt_mem_pool_cleanup_t *mpcl; @@ -96,6 +97,8 @@ nxt_job_cleanup_add(nxt_mem_pool_t *mp, nxt_job_t *job) return NXT_ERROR; } +#endif + /* * The (void *) casts in nxt_thread_pool_post() and nxt_event_engine_post() |