only use js_free for memory allocated in the js::MallocArena
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
People
(Reporter: sfink, Assigned: sfink, NeedInfo)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Keywords: leave-open)
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
As the comment says:
static inline void js_free(void* p) {
// TODO: This should call |moz_arena_free(js::MallocArena, p)| but we
// currently can't enforce that all memory freed here was allocated by
// js_malloc().
free(p);
}
An example of an allocation that would not be in this arena is ArrayBuffer data, which gets allocated into its own js::ArrayBufferContentsArena
. Or at least, sometimes it does.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Comment 3•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 4•2 years ago
|
||
Other than an assertion there's currently no reason to free memory in its own arena.
https://searchfox.org/mozilla-central/source/memory/build/mozjemalloc.cpp#3634
jemalloc will always find the correct arena based on the memory's location and then use that, the only time aArena
is used is for the above assertion. But if we ever switch to a more pedantic allocator this could be relevant.
Comment 5•1 year ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:sfink, maybe it's time to close this bug?
For more information, please visit BugBot documentation.
Description
•