From 2d951bfa417f0e125708d5dac64f2f0b91610e07 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Tue, 27 May 2008 09:37:40 +0000 Subject: *) 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() --- src/http/ngx_http.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/http/ngx_http.c') 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; -- cgit