Mercurial > hg > nginx-vendor-0-6
annotate src/os/unix/ngx_alloc.c @ 376:d13234035cad NGINX_0_6_32
nginx 0.6.32
*) Change: the "none" parameter in the "ssl_session_cache" directive;
now this is default parameter.
Thanks to Rob Mueller.
*) Change: now the 0x00-0x1F, '"' and '\' characters are escaped as
\xXX in an access_log.
Thanks to Maxim Dounin.
*) Change: now nginx allows several "Host" request header line.
*) Feature: the "modified" flag in the "expires" directive.
*) Feature: the $uid_got and $uid_set variables may be used at any
request processing stage.
*) Feature: the $hostname variable.
Thanks to Andrei Nigmatulin.
*) Feature: DESTDIR support.
Thanks to Todd A. Fisher and Andras Voroskoi.
*) Bugfix: if sub_filter and SSI were used together, then responses
might were transferred incorrectly.
*) Bugfix: large SSI inclusions might be truncated.
*) Bugfix: the "proxy_pass" directive did not work with the HTTPS
protocol; the bug had appeared in 0.6.9.
*) Bugfix: worker processes might not catch reconfiguration and log
rotation signals.
*) Bugfix: nginx could not be built on latest Fedora 9 Linux.
Thanks to Roxis.
*) Bugfix: a segmentation fault might occur in worker process on Linux,
if keepalive was enabled.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 07 Jul 2008 00:00:00 +0400 |
parents | 6ae1357b7b7c |
children |
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 |