Mercurial > hg > nginx-vendor-current
annotate src/os/unix/ngx_alloc.c @ 634:23ef0645ea57 NGINX_1_1_1
nginx 1.1.1
*) Change: now cache loader processes either as many files as specified
by "loader_files" parameter or works no more than time specified by
"loader_threshold" parameter during each iteration.
*) Change: now SIGWINCH signal works only in deamon mode.
*) Feature: now shared zones and caches use POSIX semaphores on
Solaris.
Thanks to Den Ivanov.
*) Feature: accept filters are now supported on NetBSD.
*) Bugfix: nginx could not be build on Linux 3.0.
*) Bugfix: nginx did not use gzipping in some cases; the bug had
appeared in 1.1.0.
*) Bugfix: request body might be incorrectly processed if client used
pipelining.
*) Bugfix: in the "request_body_in_single_buf" directive.
*) Bugfix: in "proxy_set_body" and "proxy_pass_request_body" directives
if SSL connection to backend was used.
*) Bugfix: nginx hogged CPU if all servers in an upstream were marked
as "down".
*) Bugfix: a segmentation fault might occur during reconfiguration if
ssl_session_cache was defined but not used in a previous
configuration.
*) Bugfix: a segmentation fault might occur in a worker process if many
backup servers were used in an upstream.
*) Bugfix: a segmentation fault might occur in a worker process if
"fastcgi/scgi/uwsgi_param" directives were used with values starting
with "HTTP_"; the bug had appeared in 0.8.40.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 22 Aug 2011 00:00:00 +0400 |
parents | ab7d265273ed |
children | d0f7a625f27c |
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, |
546 | 24 "malloc(%uz) 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; | |
546 | 54 int err; |
0 | 55 |
546 | 56 err = posix_memalign(&p, alignment, size); |
57 | |
58 if (err) { | |
59 ngx_log_error(NGX_LOG_EMERG, log, err, | |
60 "posix_memalign(%uz, %uz) failed", alignment, size); | |
61 p = NULL; | |
0 | 62 } |
63 | |
548 | 64 ngx_log_debug3(NGX_LOG_DEBUG_ALLOC, log, 0, |
546 | 65 "posix_memalign: %p:%uz @%uz", p, size, alignment); |
0 | 66 |
67 return p; | |
68 } | |
69 | |
18 | 70 #elif (NGX_HAVE_MEMALIGN) |
0 | 71 |
50 | 72 void * |
73 ngx_memalign(size_t alignment, size_t size, ngx_log_t *log) | |
0 | 74 { |
75 void *p; | |
76 | |
50 | 77 p = memalign(alignment, size); |
78 if (p == NULL) { | |
0 | 79 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, |
546 | 80 "memalign(%uz, %uz) failed", alignment, size); |
0 | 81 } |
82 | |
548 | 83 ngx_log_debug3(NGX_LOG_DEBUG_ALLOC, log, 0, |
546 | 84 "memalign: %p:%uz @%uz", p, size, alignment); |
0 | 85 |
86 return p; | |
87 } | |
88 | |
89 #endif |