use memory optimization for i386 and amd64 only:

this fixes SIGBUS in PCRE on sparc64
This commit is contained in:
Igor Sysoev 2007-05-21 13:49:35 +00:00
parent 0687cb9d99
commit 2517fbf2b8

View File

@ -97,10 +97,21 @@ ngx_palloc(ngx_pool_t *pool, size_t size)
for ( ;; ) {
#if (NGX_HAVE_NONALIGNED)
/*
* allow non-aligned memory blocks for small allocations (1, 2,
* or 3 bytes) and for odd length strings (struct's have aligned
* size)
*/
if (size < sizeof(int) || (size & 1)) {
m = p->last;
} else {
} else
#endif
{
m = ngx_align_ptr(p->last, NGX_ALIGNMENT);
}