Last Comment Bug 760812 - correct bitflags for objects allocated by size in nsPresArena
: correct bitflags for objects allocated by size in nsPresArena
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Layout: Misc Code (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla16
Assigned To: Nathan Froyd [:froydnj]
:
Mentors:
Depends on:
Blocks: 674922
  Show dependency treegraph
 
Reported: 2012-06-02 07:55 PDT by Nathan Froyd [:froydnj]
Modified: 2012-06-06 08:29 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (917 bytes, patch)
2012-06-02 07:55 PDT, Nathan Froyd [:froydnj]
roc: review+
Details | Diff | Splinter Review

Description Nathan Froyd [:froydnj] 2012-06-02 07:55:21 PDT
Created attachment 629476 [details] [diff] [review]
patch

nsPresArena.h says:

  enum ObjectID {
    nsLineBox_id = nsQueryFrame::NON_FRAME_MARKER,

    // The PresArena implementation uses this bit to distinguish objects
    // allocated by size from objects allocated by type ID (that is, frames
    // using AllocateByFrameID and other objects using AllocateByObjectID).
    // It should not collide with any Object ID (above) or frame ID (in
    // nsQueryFrame.h).  It is not 0x80000000 to avoid the question of
    // whether enumeration constants are signed.
    NON_OBJECT_MARKER = 0x40000000
  };

but the actual implementation of AllocateBySize wrongly uses nsQueryFrame::NON_FRAME_MARKER instead of NON_OBJECT_MARKER.  (nsPresArena.cpp doesn't even use NON_OBJECT_MARKER currently.)  If we were to add more ObjectIDs for better arena allocation statistics, we'd eventually run into problems, though it would take a while.  Let's fix this.
Comment 2 Ed Morley [:emorley] 2012-06-06 08:29:31 PDT
https://hg.mozilla.org/mozilla-central/rev/4cb9c03a3804

Note You need to log in before you can comment on or make changes to this bug.