diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-10-17 16:22:38 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-10-17 16:22:38 +0300 |
commit | 09ef66d39c277ed709e2333f992b1d87304bf663 (patch) | |
tree | 980e60508cb4c86b2a6637616001d10eaeb8f393 /src/nxt_event_engine.c | |
parent | 1c6d4d8cff1f9c2da56ce6cc433c17b2d69fca2b (diff) | |
download | unit-09ef66d39c277ed709e2333f992b1d87304bf663.tar.gz unit-09ef66d39c277ed709e2333f992b1d87304bf663.tar.bz2 |
Storing memory cache slot hint inside nxt_sockaddr_t.
Diffstat (limited to 'src/nxt_event_engine.c')
-rw-r--r-- | src/nxt_event_engine.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nxt_event_engine.c b/src/nxt_event_engine.c index e275571c..0b40d552 100644 --- a/src/nxt_event_engine.c +++ b/src/nxt_event_engine.c @@ -556,10 +556,10 @@ nxt_event_engine_start(nxt_event_engine_t *engine) void * -nxt_event_engine_mem_alloc(nxt_event_engine_t *engine, uint32_t *slot, +nxt_event_engine_mem_alloc(nxt_event_engine_t *engine, uint8_t *slot, size_t size) { - uint32_t n; + uint8_t n; nxt_uint_t items; nxt_array_t *mem_cache; nxt_mem_cache_t *cache; @@ -568,7 +568,7 @@ nxt_event_engine_mem_alloc(nxt_event_engine_t *engine, uint32_t *slot, mem_cache = engine->mem_cache; n = *slot; - if (n == (uint32_t) -1) { + if (n == (uint8_t) -1) { if (mem_cache == NULL) { /* IPv4 nxt_sockaddr_t and HTTP/1 and HTTP/2 buffers. */ @@ -618,7 +618,6 @@ nxt_event_engine_mem_alloc(nxt_event_engine_t *engine, uint32_t *slot, if (block != NULL) { cache->free = block->next; cache->count--; - return block; } @@ -627,7 +626,7 @@ nxt_event_engine_mem_alloc(nxt_event_engine_t *engine, uint32_t *slot, void -nxt_event_engine_mem_free(nxt_event_engine_t *engine, uint32_t *slot, void *p) +nxt_event_engine_mem_free(nxt_event_engine_t *engine, uint8_t *slot, void *p) { nxt_mem_cache_t *cache; nxt_mem_cache_block_t *block; |