mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
nginx-0.0.3-2004-06-08-20:26:37 import
This commit is contained in:
parent
0ab91b9012
commit
3eb1995529
@ -126,9 +126,15 @@ void *ngx_palloc(ngx_pool_t *pool, size_t size)
|
|||||||
large->next = NULL;
|
large->next = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (!(p = ngx_memalign(ngx_pagesize, size, pool->log))) {
|
if (!(p = ngx_memalign(ngx_pagesize, size, pool->log))) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (!(p = ngx_alloc(size, pool->log))) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (pool->large == NULL) {
|
if (pool->large == NULL) {
|
||||||
pool->large = large;
|
pool->large = large;
|
||||||
|
@ -38,11 +38,11 @@ void *ngx_calloc(size_t size, ngx_log_t *log)
|
|||||||
|
|
||||||
#if (HAVE_POSIX_MEMALIGN)
|
#if (HAVE_POSIX_MEMALIGN)
|
||||||
|
|
||||||
void *ngx_memalign(size_t aligment, size_t size, ngx_log_t *log)
|
void *ngx_memalign(size_t alignment, size_t size, ngx_log_t *log)
|
||||||
{
|
{
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
if (posix_memalign(&p, aligment, size) == -1) {
|
if (posix_memalign(&p, alignment, size) == -1) {
|
||||||
ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
|
ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
|
||||||
"posix_memalign() " SIZE_T_FMT " bytes aligned to "
|
"posix_memalign() " SIZE_T_FMT " bytes aligned to "
|
||||||
SIZE_T_FMT " failed", size, alignment);
|
SIZE_T_FMT " failed", size, alignment);
|
||||||
@ -54,13 +54,13 @@ void *ngx_memalign(size_t aligment, size_t size, ngx_log_t *log)
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
#esif (HAVE_MEMALIGN)
|
#elif (HAVE_MEMALIGN)
|
||||||
|
|
||||||
void *ngx_memalign(size_t aligment, size_t size, ngx_log_t *log)
|
void *ngx_memalign(size_t alignment, size_t size, ngx_log_t *log)
|
||||||
{
|
{
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
if (!(p = memalign(aligment, size))) {
|
if (!(p = memalign(alignment, size))) {
|
||||||
ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
|
ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
|
||||||
"memalign() " SIZE_T_FMT " bytes aligned to "
|
"memalign() " SIZE_T_FMT " bytes aligned to "
|
||||||
SIZE_T_FMT " failed", size, alignment);
|
SIZE_T_FMT " failed", size, alignment);
|
||||||
|
Loading…
Reference in New Issue
Block a user