diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2008-05-27 09:37:40 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2008-05-27 09:37:40 +0000 |
| commit | 2d951bfa417f0e125708d5dac64f2f0b91610e07 (patch) | |
| tree | 0b14f8805c1eb6ba8104c1f377ad17fbc6257f70 /src/http/ngx_http.c | |
| parent | 626cd7e7be4d40d19e75e0960752c64aebd544d9 (diff) | |
| download | nginx-2d951bfa417f0e125708d5dac64f2f0b91610e07.tar.gz nginx-2d951bfa417f0e125708d5dac64f2f0b91610e07.tar.bz2 | |
*) 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 '')
| -rw-r--r-- | src/http/ngx_http.c | 7 |
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; |
