Mercurial > hg > nginx-vendor-0-8
annotate src/os/unix/ngx_alloc.c @ 358:9121a0a91f47 NGINX_0_6_23
nginx 0.6.23
*) Change: the "off" parameter in the "ssl_session_cache" directive;
now this is default parameter.
*) Change: the "open_file_cache_retest" directive was renamed to the
"open_file_cache_valid".
*) Feature: the "open_file_cache_min_uses" directive.
*) Feature: the ngx_http_gzip_static_module.
*) Feature: the "gzip_disable" directive.
*) Feature: the "memcached_pass" directive may be used inside the "if"
block.
*) Bugfix: a segmentation fault occurred in worker process, if the
"memcached_pass" and "if" directives were used in the same location.
*) Bugfix: if a "satisfy_any on" directive was used and not all access
and auth modules directives were set, then other given access and
auth directives were not tested;
*) Bugfix: regex parameters in a "valid_referers" directive were not
inherited from previous level.
*) Bugfix: a "post_action" directive did run if a request was completed
with 499 status code.
*) Bugfix: optimization of 16K buffer usage in a SSL connection.
Thanks to Ben Maurer.
*) Bugfix: the STARTTLS in SMTP mode did not work.
Thanks to Oleg Motienko.
*) Bugfix: in HTTPS mode requests might fail with the "bad write retry"
error; bug appeared in 0.5.13.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Thu, 27 Dec 2007 00:00:00 +0300 |
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 |