Closed Bug 1610720 Opened 6 years ago Closed 6 years ago

Change what moz_dispose_arena does

Categories

(Core :: Memory Allocator, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Currently, it's expected to "lazily" dispose of the arena. That is, if the arena still has allocations, the arena is kept around. Using it for new allocations is an error, but otherwise, it's possible to free allocations from there. Once it's empty, the arena is freed too. Well, that's the idea, but that last part is not actually implemented, cf. bug 1364359.

While that is still an (optionally) desirable disposal mode, other modes would be useful as well. So this bug is here to switch the current mode to something that can more easily be used for e.g. bug 1377999.

The idea is to make moz_dispose_arena() free the arena immediately, and MOZ_CRASH if it's not already empty.

The base_node_alloc and base_node_dealloc are wrappers for the base
allocator that allow to free memory (the base allocator doesn't support
freeing memory), using a free list. They are dedicated to extent_node_t
objects (the only ones we currently ever need to free).

We're going to need to free other types of objects, so make this more
generic.

Currently, it's expected to "lazily" dispose of the arena. That is, if
the arena still has allocations, the arena is kept around. Using it for
new allocations is an error, but otherwise, it's possible to free
allocations from there. Once it's empty, the arena is freed too. Well,
that's the idea, but that last part is not actually implemented, cf.
bug 1364359.

While that is still an (optionally) desirable disposal mode, other modes
would be useful as well. So this bug is here to switch the current mode
to something that can more easily be used for e.g. bug 1377999.

The idea is to make moz_dispose_arena() free the arena immediately, and
MOZ_CRASH if it's not already empty (on a besst effort basis).

Blocks: 1610736
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/f127766b5901 Templatize the base allocator wrapper that uses a free-list. r=erahm https://hg.mozilla.org/integration/autoland/rev/ad6570e7d414 Change moz_dispose_arena to allow to free empty arenas. r=erahm
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
Blocks: 1613011
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: