void* ngx_slab_alloc(ngx_slab_pool_t* pool, size_t size) { void* p; // 进程间加锁保护 ngx_shmtx_lock(&pool->mutex); // 申请内存块 p = ngx_slab_alloc_locked(pool, size); // 进程间解锁 ngx_shmtx_unlock(&pool->mutex); return p; } void* ngx_slab_alloc_locked(ngx_slab_p...
//garbage-collecting slab allocatorvoid*ngx_http_push_slab_alloc_locked(size_tsize){void*p;if((p =ngx_slab_alloc_locked(ngx_http_push_shpool, size))==NULL) {ngx_http_push_channel_queue_t*ccur, *cnext;ngx_uint_tcollected =0;//failed. emergency garbage sweep, then.//collect channelsn...