Closed Bug 1191529 Opened 9 years ago Closed 9 years ago

Remove JSIdArray and AutoIdArray

Categories

(Core :: JavaScript: GC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox42 --- affected
firefox43 --- fixed

People

(Reporter: terrence, Assigned: terrence)

References

Details

Attachments

(2 files)

JSIdArray is this wonderfully crufty piece of manual C-style memory mis-management that is still hanging on somehow. Its only user is JS_Enumerate. The actual work here happens into an AutoIdVector, after which we malloc and memcopy a second copy into a JSIdArray and return that so that the caller can root it with AutoId*Array*.

Instead, let's just have the caller pass in a handle to an IdVector. Unfortunately, AutoIdVector is not really a vector, so we can't avoid the copy yet, but this should be fixed soon when we remove AutoIdVector.
Attachment #8643970 - Flags: review?(jcoppeard)
Converting gecko to the new API was trivial: add an outparam and convert to standard SM return conventions.
Attachment #8643972 - Flags: review?(bugs)
Comment on attachment 8643972 [details] [diff] [review]
2_remove_AutoIdArray_gecko-v0.diff

I'm sure Andrew wants to review this ;)
Attachment #8643972 - Flags: review?(bugs) → review?(continuation)
Attachment #8643972 - Flags: review?(continuation) → review+
Comment on attachment 8643970 [details] [diff] [review]
1_remove_AutoIdArray_sm-v0.diff

Review of attachment 8643970 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsatom.h
@@ -26,5 @@
> -    js::HeapId* begin() { return vector; }
> -    const js::HeapId* begin() const { return vector; }
> -    js::HeapId* end() { return vector + length; }
> -    const js::HeapId* end() const { return vector + length; }
> -};

Nice to see this go!
Attachment #8643970 - Flags: review?(jcoppeard) → review+
https://hg.mozilla.org/mozilla-central/rev/f8da9d2fc8dd
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Depends on: 1315842
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: