mirror of
https://github.com/nginx/nginx.git
synced 2025-08-06 14:56:15 +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 ( ;; ) {
|
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)) {
|
if (size < sizeof(int) || (size & 1)) {
|
||||||
m = p->last;
|
m = p->last;
|
||||||
|
|
||||||
} else {
|
} else
|
||||||
|
#endif
|
||||||
|
|
||||||
|
{
|
||||||
m = ngx_align_ptr(p->last, NGX_ALIGNMENT);
|
m = ngx_align_ptr(p->last, NGX_ALIGNMENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user