Mercurial > hg > nginx
view src/os/win32/ngx_alloc.c @ 4725:47936d1c98e9 stable-1.2
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.
*) Fixed spelling of "endianness", and called it "byte ordering" in the
user visible part.
*) Fixed return type of ngx_strerror_init().
*) Fixed a harmless error in spelling of "Connection: close" when computing
the response header length.
*) Style.
*) Added code to look up Google perftools in /opt/local/, for MacPorts.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 02 Jul 2012 16:51:02 +0000 |
parents | d620f497c50f |
children |
line wrap: on
line source
/* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #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) 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; }