Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-05-27 13:37:40 +0400
committerIgor Sysoev <igor@sysoev.ru>2008-05-27 13:37:40 +0400
commit2d951bfa417f0e125708d5dac64f2f0b91610e07 (patch)
tree0b14f8805c1eb6ba8104c1f377ad17fbc6257f70 /src/http/ngx_http.c
parent626cd7e7be4d40d19e75e0960752c64aebd544d9 (diff)
*) add ngx_palloc_aligned() to allocate explicitlty aligned memory
*) allows non-aligned memory blocks for small allocations and for odd length strings on all platforms *) use ngx_palloc_aligned()
Diffstat (limited to 'src/http/ngx_http.c')
-rw-r--r--src/http/ngx_http.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index a1c4c9892..e8e059c22 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -1024,12 +1024,15 @@ ngx_http_create_locations_tree(ngx_conf_t *cf, ngx_queue_t *locations,
lq = (ngx_http_location_queue_t *) q;
len = lq->name->len - prefix;
- node = ngx_pcalloc(cf->pool,
- offsetof(ngx_http_location_tree_node_t, name) + len);
+ node = ngx_palloc_aligned(cf->pool,
+ offsetof(ngx_http_location_tree_node_t, name) + len);
if (node == NULL) {
return NULL;
}
+ node->left = NULL;
+ node->right = NULL;
+ node->tree = NULL;
node->exact = lq->exact;
node->inclusive = lq->inclusive;