comparison src/http/ngx_http.c @ 2049:2a92804f4109

*) back out r2040 *) refactor ngx_palloc() *) introduce ngx_pnalloc() *) additional pool blocks have smaller header
author Igor Sysoev <igor@sysoev.ru>
date Tue, 17 Jun 2008 15:00:30 +0000
parents 6389d4accacf
children 8c6521eedf84
comparison
equal deleted inserted replaced
2048:824615f3b4ec 2049:2a92804f4109
1022 q = ngx_queue_middle(locations); 1022 q = ngx_queue_middle(locations);
1023 1023
1024 lq = (ngx_http_location_queue_t *) q; 1024 lq = (ngx_http_location_queue_t *) q;
1025 len = lq->name->len - prefix; 1025 len = lq->name->len - prefix;
1026 1026
1027 node = ngx_palloc_aligned(cf->pool, 1027 node = ngx_palloc(cf->pool,
1028 offsetof(ngx_http_location_tree_node_t, name) + len); 1028 offsetof(ngx_http_location_tree_node_t, name) + len);
1029 if (node == NULL) { 1029 if (node == NULL) {
1030 return NULL; 1030 return NULL;
1031 } 1031 }
1032 1032
1033 node->left = NULL; 1033 node->left = NULL;
1613 return NGX_ERROR; 1613 return NGX_ERROR;
1614 } 1614 }
1615 1615
1616 hip->port = in_port->port; 1616 hip->port = in_port->port;
1617 1617
1618 hip->port_text.data = ngx_palloc(cf->pool, 7); 1618 hip->port_text.data = ngx_pnalloc(cf->pool, 7);
1619 if (hip->port_text.data == NULL) { 1619 if (hip->port_text.data == NULL) {
1620 return NGX_ERROR; 1620 return NGX_ERROR;
1621 } 1621 }
1622 1622
1623 ls->servers = hip; 1623 ls->servers = hip;