Closed
Bug 1628014
Opened 5 years ago
Closed 3 years ago
Make Allocate functions call constructors
Categories
(Core :: JavaScript: GC, task, P3)
Core
JavaScript: GC
Tracking
()
RESOLVED
FIXED
106 Branch
| Tracking | Status | |
|---|---|---|
| firefox106 | --- | fixed |
People
(Reporter: jonco, Assigned: sfink)
References
Details
Attachments
(2 files, 1 obsolete file)
Right now to allocate a GC thing you do something like:
JSFooThing* foo = Allocate<JSFooThing>(cx);
new (foo) JSFooThing(some, args);
It would be more idiomatic to pass the constructor argument through Allocate, like this:
JSFooThing* foo = Allocate<JSFooThing>(cx, some, args);
In some cases we don't call a constructor at all, and that may be undefined behaviour depending on the class itself. Always calling a constructor would prevent this possibility.
| Assignee | ||
Updated•4 years ago
|
Assignee: nobody → sphink
Status: NEW → ASSIGNED
| Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Attachment #9258153 -
Attachment description: Bug 1628014 - Add typed Cell::Allocate<T>() and cx->Allocate<T>() methods → Bug 1628014 - Add typed Cell::NewCell<T>() and cx->NewCell<T>() methods
| Assignee | ||
Comment 2•4 years ago
|
||
Updated•4 years ago
|
Attachment #9258153 -
Attachment description: Bug 1628014 - Add typed Cell::NewCell<T>() and cx->NewCell<T>() methods → Bug 1628014 - Add typed Cell::NewCell<T>() and cx->newCell<T>() methods
Updated•4 years ago
|
Attachment #9258403 -
Attachment is obsolete: true
| Assignee | ||
Comment 3•3 years ago
|
||
Pushed by sfink@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/34625c0ebf21
Add typed Cell::NewCell<T>() and cx->newCell<T>() methods r=jonco,tcampbell
https://hg.mozilla.org/integration/autoland/rev/6952a8524c26
Replace StringT::emplace() methods with direct calls to constructor (from a friend struct). r=arai
Comment 5•3 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/34625c0ebf21
https://hg.mozilla.org/mozilla-central/rev/6952a8524c26
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
status-firefox106:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•