Closed Bug 778056 Opened 12 years ago Closed 12 years ago

malloc_usable_size is also available in libc on FreeBSD

Categories

(Core :: Memory Allocator, defect)

All
FreeBSD
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: jbeich, Unassigned)

References

Details

Attachments

(1 file)

      No description provided.
FreeBSD has jemalloc in base since 7.0 with working malloc_usable_size (unlike NetBSD).
It was updated to 3.0.0 in 10.0-CURRENT (2012-04-17).
--enable-jemalloc build fails:

/a/mozilla-central/memory/mozalloc/mozalloc.cpp:215:12: error: use of undeclared identifier
      'malloc_usable_size'; did you mean 'moz_malloc_usable_size'?

while default build has:

$ firefox -P test -no-remote about:memory
WARNING: the 'heap-allocated' memory reporter and the moz_malloc_usable_size() function do not work for this platform and/or configuration.  This means that 'heap-unclassified\
' is not shown and the 'explicit' tree shows much less memory than it should.

WARNING: the following values are negative or unreasonably large.
 explicit/window-objects/top(chrome://browser/content/browser.xul, id=1)/active/window(chrome://browser/content/browser.xul)/layout/pres-shell
 explicit/window-objects/top(about:memory, id=8)/active/window(about:memory)/js/compartment([System Principal], about:memory)/analysis-temporary
 explicit/window-objects/top(about:memory, id=8)/active/window(about:memory)/layout/pres-shell
 explicit/window-objects/top(about:memory, id=8)/active/window(about:blank)/js/compartment(about:blank)/analysis-temporary
 explicit/window-objects/(3 tiny)/top(about:blank, id=7)/active/window(about:blank)/js/compartment(about:blank)/analysis-temporary
 explicit/window-objects/(3 tiny)/top(about:blank, id=5)/active/window(about:blank)/js/compartment(about:blank)/analysis-temporary
 explicit/window-objects/(3 tiny)/top(resource://gre-resources/hiddenWindow.html, id=3)/active/window(resource://gre-resources/hiddenWindow.html)/layout/pres-shell
 js-main-runtime/compartments/(3 tiny)/analysis-temporary
 window-objects/layout/rule-nodes
 window-objects/layout/frames
 window-objects/layout/style-contexts
 window-objects/layout/line-boxes
 window-objects/layout/pres-shell
This indicates a defect in one or more memory reporters.  The invalid values are highlighted.

After applying the patch:

$ firefox -P test -no-remote about:memory
WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.
Attachment #646484 - Flags: review?(justin.lebar+bug)
Comment on attachment 646484 [details] [diff] [review]
fix the warning in about:memory when using system malloc

Cool.

https://hg.mozilla.org/integration/mozilla-inbound/rev/93a4e2bbcd95

btw, most Mozilla hackers are not set up to push git-formatted patches to hg, so would have had some difficulty with this patch.  You can convert git patches to hg patches using git-patch-to-hg-patch in moz-git-tools [1].

It's also customary to attach patches with 8 lines of context.

git-bz (also in moz-git-tools) is a bit of a pain to set up, but will do all this for you.

[1] https://github.com/jlebar/moz-git-tools
Attachment #646484 - Flags: review?(justin.lebar+bug) → review+
https://hg.mozilla.org/mozilla-central/rev/93a4e2bbcd95
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
Blocks: 791366
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: