mirror of
https://github.com/nginx/nginx.git
synced 2024-12-01 11:19:00 +08:00
use memory optimization for i386 and amd64 only:
this fixes SIGBUS in PCRE on sparc64
This commit is contained in:
parent
0687cb9d99
commit
2517fbf2b8
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user