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

RESOLVED FIXED in mozilla5

Status

()

Core
Layout
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: mats, Assigned: mats)

Tracking

({regression})

Trunk
mozilla5
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

7 years ago
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
(Assignee)

Comment 1

7 years ago
Created attachment 522165 [details] [diff] [review]
Always init poison value

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+
(Assignee)

Comment 3

7 years ago
Created attachment 522167 [details] [diff] [review]
Don't poison nsRuleData in --enable-valgrind build

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+
(Assignee)

Comment 5

7 years ago
Created attachment 522171 [details] [diff] [review]
Don't poison nsRuleData in --enable-valgrind build

Ok, updated as suggested.
Assignee: nobody → matspal
Attachment #522167 - Attachment is obsolete: true
Status: NEW → ASSIGNED
http://hg.mozilla.org/mozilla-central/rev/7e0d493e7b10
http://hg.mozilla.org/mozilla-central/rev/81d1df28a908
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED

Updated

7 years ago
Target Milestone: --- → mozilla2.2
Whiteboard: fixed-in-cedar
You need to log in before you can comment on or make changes to this bug.