From acadd08545b96e1396d392a931e3ba781440abd9 Mon Sep 17 00:00:00 2001 From: "attinasi%netscape.com" Date: Tue, 26 Jun 2001 01:19:05 +0000 Subject: [PATCH] Fixed allocation alignment problem: checking in for jim_nance@yahoo.com b=85890 r=attinasi sr=alecf git-svn-id: svn://10.0.0.236/trunk@97912 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsPresShell.cpp | 8 ++++---- mozilla/layout/html/base/src/nsPresShell.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 8a8d107a6a8..bc80d647419 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -558,8 +558,8 @@ FrameArena::AllocateFrame(size_t aSize, void** aResult) { void* result = nsnull; - // Round size to multiple of 4 - aSize = PR_ROUNDUP(aSize, 4); + // Ensure we have correct alignment for pointers. Important for Tru64 + aSize = PR_ROUNDUP(aSize, sizeof(void*)); // Check recyclers first if (aSize < gMaxRecycledSize) { @@ -585,8 +585,8 @@ FrameArena::AllocateFrame(size_t aSize, void** aResult) nsresult FrameArena::FreeFrame(size_t aSize, void* aPtr) { - // Round size to multiple of 4 - aSize = PR_ROUNDUP(aSize, 4); + // Ensure we have correct alignment for pointers. Important for Tru64 + aSize = PR_ROUNDUP(aSize, sizeof(void*)); // See if it's a size that we recycle if (aSize < gMaxRecycledSize) { diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 8a8d107a6a8..bc80d647419 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -558,8 +558,8 @@ FrameArena::AllocateFrame(size_t aSize, void** aResult) { void* result = nsnull; - // Round size to multiple of 4 - aSize = PR_ROUNDUP(aSize, 4); + // Ensure we have correct alignment for pointers. Important for Tru64 + aSize = PR_ROUNDUP(aSize, sizeof(void*)); // Check recyclers first if (aSize < gMaxRecycledSize) { @@ -585,8 +585,8 @@ FrameArena::AllocateFrame(size_t aSize, void** aResult) nsresult FrameArena::FreeFrame(size_t aSize, void* aPtr) { - // Round size to multiple of 4 - aSize = PR_ROUNDUP(aSize, 4); + // Ensure we have correct alignment for pointers. Important for Tru64 + aSize = PR_ROUNDUP(aSize, sizeof(void*)); // See if it's a size that we recycle if (aSize < gMaxRecycledSize) {