Closed Bug 645423 Opened 9 years ago Closed 9 years ago

nsPresArena.cpp fails to build with -DDEBUG_TRACEMALLOC_PRESARENA. (ARENA_POISON undefined)

Categories

(Core :: Layout, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla5

People

(Reporter: mats, Assigned: mats)

References

Details

(Keywords: regression)

Attachments

(2 files, 1 obsolete file)

layout/base/nsPresArena.cpp: In static member function 'static PRUword nsPresArena::GetPoisonValue()':
layout/base/nsPresArena.cpp:471: error: 'ARENA_POISON' was not declared in this scope
make[2]: *** [nsPresArena.o] Error 1
Move the setup of the poison value outside the
#ifndef DEBUG_TRACEMALLOC_PRESARENA
so it's always available.

Call the one-time init function also when DEBUG_TRACEMALLOC_PRESARENA
is defined.

This fixes the compilation error.
Attachment #522165 - Flags: review?(dbaron)
Comment on attachment 522165 [details] [diff] [review]
Always init poison value

r=dbaron.  Thanks for fixing this.
Attachment #522165 - Flags: review?(dbaron) → review+
Also, wouldn't it be better to leave 'mValueOffsets' uninitialized
in a --enable-valgrind build and let valgrind catch any memory errors?
Attachment #522167 - Flags: review?(dbaron)
Comment on attachment 522167 [details] [diff] [review]
Don't poison nsRuleData in --enable-valgrind build

r=dbaron, except I think it's simpler to skip the .h change and just have an #ifndef MOZ_VALGRIND block inside the destructor just like the one in the constructor.  No point worrying about inlining in DEBUG builds, and it makes the code easier to understand.
Attachment #522167 - Flags: review?(dbaron) → review+
Ok, updated as suggested.
Assignee: nobody → matspal
Attachment #522167 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla2.2
Whiteboard: fixed-in-cedar
You need to log in before you can comment on or make changes to this bug.