Closed Bug 607340 Opened 14 years ago Closed 14 years ago

Need new operator with flags exposed

Categories

(Tamarin Graveyard :: Garbage Collection (mmGC), defect, P2)

x86
All
defect

Tracking

(Not tracked)

RESOLVED FIXED
Q3 11 - Serrano

People

(Reporter: treilly, Assigned: treilly)

References

Details

Attachments

(1 file)

There's no way to set custom alloc flags on a GCObject new call, add this.

This is necessary to allocate with kContainsPointers left off where we want to do that.   Placement new isn't an option for class with its own new operators (ie GCObject subclasses).

Blocks write barrier fix which requires a player fix which requires this change.
Attachment #486073 - Flags: review?(lhansen)
Blocking WE bug 2744511
Blocks: 607393
No longer blocks: 607393
Depends on: 607393
Comment on attachment 486073 [details] [diff] [review]
add new with flags to GCObject

I'm fine with the operator but I think you need to fix the type of the flags argument from 'int' to something else.  For example, we have two definitions of kZero in MMgc and they do not have the same value.  It's way too easy to pick the wrong one.
Attachment #486073 - Flags: review?(lhansen) → review+
(In fact a safe API here would pass a struct that has individual flag fields in it, not a bit vector, but that's probably too wrenching a change from how we do it elsewhere.)
http://hg.mozilla.org/tamarin-redux/rev/aa289d865717

Good call on using the enum, my player patch was actually using the wrong kZero but it did have the same value.   We actually have 3 kZeros (!!) FixedMallocOpts, GCHeap::AllocFlags and GC::AllocFlags.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Ah, see I knew there were three but my grep only found two...

I actually think that we would benefit from unifying the flags - there should be only one kZero, only one kContainsPointers, etc.  Not all flags would apply to all allocators obviously, but so what - comments can clarify that.  And they should all be directly in the MMgc namespace and easy to get to.

In the intermediate term the other definitions can just alias the ones from the MMgc namespace.

I will create a bug to this effect.
Flags: flashplayer-bug-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: