Closed Bug 576776 Opened 14 years ago Closed 14 years ago

mozalloc landing broke trace-malloc on Linux

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b2

People

(Reporter: dbaron, Assigned: dbaron)

Details

Attachments

(1 file, 1 obsolete file)

The mozalloc landing broke trace-malloc on Linux -- it now only overrides calls to malloc that go through moz_malloc, and doesn't override other calls to malloc (and likewise for the other functions).

I think the right fix is just adding:
>/*
> * We need to redefine |malloc|, etc. in this file; without this, we'll
> * end up redefining |moz_malloc|, etc. instead.
> */
>#define MOZALLOC_DONT_DEFINE_MACRO_WRAPPERS
to the top of nsTraceMalloc.c -- it looks like mozalloc doesn't actually try to override malloc itself, so nsTraceMalloc can still continue to do so.


This would probably explain the massive drop in leak stats on Linux.
>#define MOZALLOC_DONT_DEFINE_MACRO_WRAPPERS

That  macro is actually just defined in one place and never used (probably dead code).  But the undef header looks like it'll work.
Attached patch patch (obsolete) — Splinter Review
Attachment #455880 - Flags: review?(jones.chris.g)
Comment on attachment 455880 [details] [diff] [review]
patch

Hm ... bad.  I sure thought we had something like this in place.  Thanks.

I prefer -DMOZ_NO_MOZALLOC in Makefile.in to this fix.
Attached patch patch 2Splinter Review
... as requested
Attachment #455880 - Attachment is obsolete: true
Attachment #457952 - Flags: review?(jones.chris.g)
Attachment #455880 - Flags: review?(jones.chris.g)
Comment on attachment 457952 [details] [diff] [review]
patch 2

Thanks.
Attachment #457952 - Flags: review?(jones.chris.g) → review+
http://hg.mozilla.org/mozilla-central/rev/46af914448ae
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: