Closed Bug 645423 Opened 10 years ago Closed 10 years ago
Pres Arena .cpp fails to build with -DDEBUG _TRACEMALLOC _PRESARENA . (ARENA _POISON undefined)
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: *** [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
Fixed in Cedar: http://hg.mozilla.org/projects/cedar/rev/7e0d493e7b10 http://hg.mozilla.org/projects/cedar/rev/81d1df28a908
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.