在 src\http\modules\ngx_http_map_module.c
static void *
ngx_http_map_create_conf(ngx_conf_t *cf)
{ngx_http_map_conf_t *mcf;mcf = ngx_palloc(cf->pool, sizeof(ngx_http_map_conf_t));if (mcf == NULL) {return NULL;}mcf->hash_max_size = NGX_CONF_UNSET_UINT;mcf->hash_bucket_size = NGX_CONF_UNSET_UINT;return mcf;
}
该函数 ngx_http_map_create_conf
的作用是为 Nginx 的 HTTP map 模块创建并初始化配置结构体
mcf = ngx_palloc(cf->pool, sizeof(ngx_http_map_conf_t));if (mcf == NULL) {return NULL;}
分配内存,作为一个 ngx_http_map_conf_t 结构体
这个地址也是函数的返回值
mcf->hash_max_size = NGX_CONF_UNSET_UINT;mcf->hash_bucket_size = NGX_CONF_UNSET_UINT;
初始化以上字段,其值代表 尚未设置
return mcf;
返回 结构体的地址