changeset 347:f48d579daf78

nginx-0.0.3-2004-06-08-20:26:37 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 08 Jun 2004 16:26:37 +0000
parents 55e496a8ece3
children 68ff8000a974
files src/core/ngx_palloc.c src/os/unix/ngx_alloc.c
diffstat 2 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/ngx_palloc.c
+++ b/src/core/ngx_palloc.c
@@ -126,9 +126,15 @@ void *ngx_palloc(ngx_pool_t *pool, size_
         large->next = NULL;
     }
 
+#if 0
     if (!(p = ngx_memalign(ngx_pagesize, size, pool->log))) {
         return NULL;
     }
+#else
+    if (!(p = ngx_alloc(size, pool->log))) {
+        return NULL;
+    }
+#endif
 
     if (pool->large == NULL) {
         pool->large = large;
--- a/src/os/unix/ngx_alloc.c
+++ b/src/os/unix/ngx_alloc.c
@@ -38,11 +38,11 @@ void *ngx_calloc(size_t size, ngx_log_t 
 
 #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;
 
-    if (posix_memalign(&p, aligment, size) == -1) {
+    if (posix_memalign(&p, alignment, size) == -1) {
         ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
                       "posix_memalign() " SIZE_T_FMT " bytes aligned to "
                       SIZE_T_FMT " failed", size, alignment);
@@ -54,13 +54,13 @@ void *ngx_memalign(size_t aligment, size
     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;
 
-    if (!(p = memalign(aligment, size))) {
+    if (!(p = memalign(alignment, size))) {
         ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
                       "memalign() " SIZE_T_FMT " bytes aligned to "
                       SIZE_T_FMT " failed", size, alignment);