Mercurial > hg > nginx-vendor-0-7
annotate src/os/unix/ngx_alloc.c @ 22:8b6db3bda591 NGINX_0_1_11
nginx 0.1.11
*) Feature: the worker_priority directive.
*) Change: both tcp_nopush and tcp_nodelay directives affect the
transferred response.
*) Bugfix: nginx did not call initgroups().
Thanks to Andrew Sitnikov and Andrei Nigmatulin.
*) Change: now the ngx_http_autoindex_module shows the file size in the
bytes.
*) Bugfix: the ngx_http_autoindex_module returned the 500 error if the
broken symlink was in a directory.
*) Bugfix: the files bigger than 4G could not be transferred using
sendfile.
*) Bugfix: if the backend was resolved to several backends and there
was an error while the response waiting then process may got caught
in an endless loop.
*) Bugfix: the worker process may exit with the "unknown cycle" message
when the /dev/poll method was used.
*) Bugfix: "close() channel failed" errors.
*) Bugfix: the autodetection of the "nobody" and "nogroup" groups.
*) Bugfix: the send_lowat directive did not work on Linux.
*) Bugfix: the segmentation fault occurred if there was no events
section in configuration.
*) Bugfix: nginx could not be built on OpenBSD.
*) Bugfix: the double slashes in "://" in the URI were converted to
":/".
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Thu, 02 Dec 2004 00:00:00 +0300 |
parents | 6f8b0dc0f8dd |
children | 72eb30262aac |
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 | |
11 int ngx_pagesize; | |
12 | |
13 | |
14 void *ngx_alloc(size_t size, ngx_log_t *log) | |
15 { | |
16 void *p; | |
17 | |
18 if (!(p = malloc(size))) { | |
19 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | |
10 | 20 "malloc() %uz bytes failed", size); |
0 | 21 } |
22 | |
10 | 23 ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, "malloc: %p:%uz", p, size); |
0 | 24 |
25 return p; | |
26 } | |
27 | |
28 | |
29 void *ngx_calloc(size_t size, ngx_log_t *log) | |
30 { | |
31 void *p; | |
32 | |
33 p = ngx_alloc(size, log); | |
34 | |
35 if (p) { | |
36 ngx_memzero(p, size); | |
37 } | |
38 | |
39 return p; | |
40 } | |
41 | |
42 | |
18 | 43 #if (NGX_HAVE_POSIX_MEMALIGN) |
0 | 44 |
45 void *ngx_memalign(size_t alignment, size_t size, ngx_log_t *log) | |
46 { | |
47 void *p; | |
48 | |
49 if (posix_memalign(&p, alignment, size) == -1) { | |
50 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | |
10 | 51 "posix_memalign() %uz bytes aligned to %uz failed", |
52 size, alignment); | |
0 | 53 } |
54 | |
55 ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, | |
10 | 56 "posix_memalign: %p:%uz", p, size); |
0 | 57 |
58 return p; | |
59 } | |
60 | |
18 | 61 #elif (NGX_HAVE_MEMALIGN) |
0 | 62 |
63 void *ngx_memalign(size_t alignment, size_t size, ngx_log_t *log) | |
64 { | |
65 void *p; | |
66 | |
67 if (!(p = memalign(alignment, size))) { | |
68 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | |
10 | 69 "memalign() %uz bytes aligned to %uz failed", |
70 size, alignment); | |
0 | 71 } |
72 | |
73 ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, | |
10 | 74 "memalign: %p:%uz", p, size); |
0 | 75 |
76 return p; | |
77 } | |
78 | |
79 #endif |