Mercurial > hg > nginx-vendor-current
annotate src/os/unix/ngx_alloc.c @ 326:9fc4ab6673f9 NGINX_0_6_7
nginx 0.6.7
*) Change: now the paths specified in the "include",
"auth_basic_user_file", "perl_modules", "ssl_certificate",
"ssl_certificate_key", and "ssl_client_certificate" directives are
relative to directory of nginx configuration file nginx.conf, but
not to nginx prefix directory.
*) Change: the --sysconfdir=PATH option in configure was canceled.
*) Change: the special make target "upgrade1" was defined for online
upgrade of 0.1.x versions.
*) Feature: the "server_name" and "valid_referers" directives support
regular expressions.
*) Feature: the "server" directive in the "upstream" context supports
the "backup" parameter.
*) Feature: the ngx_http_perl_module supports the
$r->discard_request_body.
*) Feature: the "add_header Last-Modified ..." directive changes the
"Last-Modified" response header line.
*) Bugfix: if an response different than 200 was returned to an request
with body and connection went to the keep-alive state after the
request, then nginx returned 400 for the next request.
*) Bugfix: a segmentation fault occurred in worker process if invalid
address was set in the "auth_http" directive.
*) Bugfix: now nginx uses default listen backlog value 511 on all
platforms except FreeBSD.
Thanks to Jiang Hong.
*) Bugfix: a worker process may got caught in an endless loop, if an
"server" inside "upstream" block was marked as "down"; bug appeared
in 0.6.6.
*) Bugfix: now Solaris sendfilev() is not used to transfer the client
request body to FastCGI-server via the unix domain socket.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 15 Aug 2007 00:00:00 +0400 |
parents | 6ae1357b7b7c |
children | e19e5f542878 |
rev | line source |
---|---|
0 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #include <ngx_config.h> | |
8 #include <ngx_core.h> | |
9 | |
10 | |
258 | 11 ngx_uint_t ngx_pagesize; |
12 ngx_uint_t ngx_pagesize_shift; | |
138 | 13 ngx_uint_t ngx_cacheline_size; |
0 | 14 |
15 | |
50 | 16 void * |
17 ngx_alloc(size_t size, ngx_log_t *log) | |
0 | 18 { |
19 void *p; | |
20 | |
50 | 21 p = malloc(size); |
22 if (p == NULL) { | |
0 | 23 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, |
10 | 24 "malloc() %uz bytes failed", size); |
0 | 25 } |
26 | |
10 | 27 ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, "malloc: %p:%uz", p, size); |
0 | 28 |
29 return p; | |
30 } | |
31 | |
32 | |
50 | 33 void * |
34 ngx_calloc(size_t size, ngx_log_t *log) | |
0 | 35 { |
36 void *p; | |
37 | |
38 p = ngx_alloc(size, log); | |
39 | |
40 if (p) { | |
41 ngx_memzero(p, size); | |
42 } | |
43 | |
44 return p; | |
45 } | |
46 | |
47 | |
18 | 48 #if (NGX_HAVE_POSIX_MEMALIGN) |
0 | 49 |
50 | 50 void * |
51 ngx_memalign(size_t alignment, size_t size, ngx_log_t *log) | |
0 | 52 { |
53 void *p; | |
54 | |
55 if (posix_memalign(&p, alignment, size) == -1) { | |
56 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | |
10 | 57 "posix_memalign() %uz bytes aligned to %uz failed", |
58 size, alignment); | |
0 | 59 } |
60 | |
61 ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, | |
10 | 62 "posix_memalign: %p:%uz", p, size); |
0 | 63 |
64 return p; | |
65 } | |
66 | |
18 | 67 #elif (NGX_HAVE_MEMALIGN) |
0 | 68 |
50 | 69 void * |
70 ngx_memalign(size_t alignment, size_t size, ngx_log_t *log) | |
0 | 71 { |
72 void *p; | |
73 | |
50 | 74 p = memalign(alignment, size); |
75 if (p == NULL) { | |
0 | 76 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, |
10 | 77 "memalign() %uz bytes aligned to %uz failed", |
78 size, alignment); | |
0 | 79 } |
80 | |
81 ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, | |
10 | 82 "memalign: %p:%uz", p, size); |
0 | 83 |
84 return p; | |
85 } | |
86 | |
87 #endif |