Mercurial > hg > nginx-vendor-1-0
view src/os/unix/ngx_alloc.c @ 398:9d81578d04bb NGINX_0_7_11
nginx 0.7.11
*) Change: now ngx_http_charset_module does not work by default with
text/css MIME type.
*) Feature: now nginx returns the 405 status code for POST method
requesting a static file only if the file exists.
*) Feature: the "proxy_ssl_session_reuse" directive.
*) Bugfix: a "proxy_pass" directive without URI part might use original
request after the "X-Accel-Redirect" redirection was used;
*) Bugfix: if a directory has search only rights and the first index
file was absent, then nginx returned the 500 status code.
*) Bugfix: in inclusive locations; the bugs had appeared in 0.7.1.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 18 Aug 2008 00:00:00 +0400 |
parents | 6ae1357b7b7c |
children | e19e5f542878 |
line wrap: on
line source
/* * Copyright (C) Igor Sysoev */ #include <ngx_config.h> #include <ngx_core.h> ngx_uint_t ngx_pagesize; ngx_uint_t ngx_pagesize_shift; ngx_uint_t ngx_cacheline_size; void * ngx_alloc(size_t size, ngx_log_t *log) { void *p; p = malloc(size); if (p == NULL) { ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "malloc() %uz bytes failed", size); } ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, "malloc: %p:%uz", p, size); return p; } void * ngx_calloc(size_t size, ngx_log_t *log) { void *p; p = ngx_alloc(size, log); if (p) { ngx_memzero(p, size); } return p; } #if (NGX_HAVE_POSIX_MEMALIGN) void * ngx_memalign(size_t alignment, size_t size, ngx_log_t *log) { void *p; if (posix_memalign(&p, alignment, size) == -1) { ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "posix_memalign() %uz bytes aligned to %uz failed", size, alignment); } ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, "posix_memalign: %p:%uz", p, size); return p; } #elif (NGX_HAVE_MEMALIGN) void * ngx_memalign(size_t alignment, size_t size, ngx_log_t *log) { void *p; p = memalign(alignment, size); if (p == NULL) { ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "memalign() %uz bytes aligned to %uz failed", size, alignment); } ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, "memalign: %p:%uz", p, size); return p; } #endif