The more regions (cells) in a run the more allocations can stay on the
"hot path". This can have a performance improvment on Linux and Windows
that corresponds to the larger page size on MacOS. On MacOS the larger
page size already implies more regions in a run.
Differential Revision: https://phabricator.services.mozilla.com/D297242
Introduce a "quantum" cell size so that free lists only ever contain
objects of the same size which improves cell reuse.
Differential Revision: https://phabricator.services.mozilla.com/D268991
This reverts commit cf54ef3dc5.
Revert "Bug 1976184 - pt 21. Try to satisfy an allocation by merging decommitted cells r=glandium"
This reverts commit 0b7c5bbd1d.
Revert "Bug 1976184 - pt 20. Add internal validation to BaseAlloc r=sergesanspaille"
This reverts commit ab036c4f66.
Revert "Bug 1976184 - pt 19. Make more memory around decommitted memory usable r=glandium"
This reverts commit c5b9d10995.
Revert "Bug 1976184 - pt 18. Decommit remainder of new chunks in BaseAlloc r=glandium"
This reverts commit 052329bd73.
Revert "Bug 1976184 - pt 17. Implement BaseAlloc::realloc r=glandium"
This reverts commit 519a7c6a97.
Revert "Bug 1976184 - pt 16. Remove wilderness allocation from BaseAlloc r=glandium"
This reverts commit 0941744917.
Revert "Bug 1976184 - pt 15. Refactor alloc path r=glandium"
This reverts commit e6ce068881.
Revert "Bug 1976184 - pt 14. Add logging to the BaseAllocator r=glandium"
This reverts commit 0378eddc45.
Revert "Bug 1976184 - pt 13. Support cell splitting r=glandium"
This reverts commit b8db220858.
Revert "Bug 1976184 - pt 12. Support cell merging r=glandium"
This reverts commit 18e891f9de.
Revert "Bug 1976184 - pt 11. Add the previous cells size to the metadata r=glandium"
This reverts commit 44abe2e601.
Revert "Bug 1976184 - pt 10. Make the size to free list mapping more efficient r=glandium"
This reverts commit b7acd4f76a.
Revert "Bug 1976184 - pt 9. Improve free list organisation r=glandium"
This reverts commit bef5da84f5.
Revert "Bug 1976184 - pt 8. Use a RB tree for the oversize free list r=glandium"
This reverts commit ca4532ff0e.
Revert "Bug 1976184 - pt 7. Move some BaseAlloc structures to a new header r=glandium"
This reverts commit f193759d4d.
Revert "Bug 1976184 - pt 6. Refactor RedBlackTree::Search r=glandium"
This reverts commit 790777fb8d.
Revert "Bug 1976184 - pt 5. Add an allocated bit r=glandium"
This reverts commit 440d0b6667.
Revert "Bug 1976184 - pt 4. Add a test case for the base allocator r=glandium"
This reverts commit 10a579aedf.
Revert "Bug 1976184 - pt 3. Add a usable_size() function r=glandium"
This reverts commit fc1e6c1372.
Revert "Bug 1976184 - pt 2. Remove the type based free list r=glandium"
This reverts commit 2d3867161e.
Revert "Bug 1976184 - pt 1. Add free list allocation to the base allocator r=glandium"
This reverts commit 53cda19c58.
Introduce a "quantum" cell size so that free lists only ever contain
objects of the same size which improves cell reuse.
Differential Revision: https://phabricator.services.mozilla.com/D268991
This reverts commit a8cc298882.
Revert "Bug 1976184 - pt 21. Try to satisfy an allocation by merging decommitted cells r=glandium"
This reverts commit 10498cc042.
Revert "Bug 1976184 - pt 20. Add internal validation to BaseAlloc r=sergesanspaille"
This reverts commit 2cb726424d.
Revert "Bug 1976184 - pt 19. Make more memory around decommitted memory usable r=glandium"
This reverts commit 7fa3a3781f.
Revert "Bug 1976184 - pt 18. Decommit remainder of new chunks in BaseAlloc r=glandium"
This reverts commit 8b9666721b.
Revert "Bug 1976184 - pt 17. Implement BaseAlloc::realloc r=glandium"
This reverts commit 698f760cfa.
Revert "Bug 1976184 - pt 16. Remove wilderness allocation from BaseAlloc r=glandium"
This reverts commit dd68acf2ee.
Revert "Bug 1976184 - pt 15. Refactor alloc path r=glandium"
This reverts commit 552670ac4b.
Revert "Bug 1976184 - pt 14. Add logging to the BaseAllocator r=glandium"
This reverts commit 447fc0e66e.
Revert "Bug 1976184 - pt 13. Support cell splitting r=glandium"
This reverts commit 92cc0dd6ad.
Revert "Bug 1976184 - pt 12. Support cell merging r=glandium"
This reverts commit 89c64d1ec2.
Revert "Bug 1976184 - pt 11. Add the previous cells size to the metadata r=glandium"
This reverts commit d5c17f0234.
Revert "Bug 1976184 - pt 10. Make the size to free list mapping more efficient r=glandium"
This reverts commit f120dda336.
Revert "Bug 1976184 - pt 9. Improve free list organisation r=glandium"
This reverts commit 891183bd4f.
Revert "Bug 1976184 - pt 8. Use a RB tree for the oversize free list r=glandium"
This reverts commit bd7857f56e.
Revert "Bug 1976184 - pt 7. Move some BaseAlloc structures to a new header r=glandium"
This reverts commit 0933ec0ea4.
Revert "Bug 1976184 - pt 6. Refactor RedBlackTree::Search r=glandium"
This reverts commit 60ce51a113.
Revert "Bug 1976184 - pt 5. Add an allocated bit r=glandium"
This reverts commit 34f1ceb178.
Revert "Bug 1976184 - pt 4. Add a test case for the base allocator r=glandium"
This reverts commit d5c2faca9f.
Revert "Bug 1976184 - pt 3. Add a usable_size() function r=glandium"
This reverts commit bb06068462.
Revert "Bug 1976184 - pt 2. Remove the type based free list r=glandium"
This reverts commit e4c837ddf7.
Revert "Bug 1976184 - pt 1. Add free list allocation to the base allocator r=glandium"
This reverts commit 5ae2c9e2c8.
Introduce a "quantum" cell size so that free lists only ever contain
objects of the same size which improves cell reuse.
Differential Revision: https://phabricator.services.mozilla.com/D268991
With page size limited to 4KiB and the quantum-wide class covering the
range from 512 bytes to 4KiB, the sub-page size class is unused and can
be removed.
Differential Revision: https://phabricator.services.mozilla.com/D259220
The test uses page size to calculate the size of the chunk header for
testing jemalloc_ptr_info. Using real page size is correct for finding
the size of the chunk header.
Differential Revision: https://phabricator.services.mozilla.com/D280544
With page size limited to 4KiB and the quantum-wide class covering the
range from 512 bytes to 4KiB, the sub-page size class is unused and can
be removed.
Differential Revision: https://phabricator.services.mozilla.com/D259220
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
clang trunk has a new warning that we turn into an error:
```
TestJemalloc.cpp:214:22: error: variable 'stackVar' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
```
Differential Revision: https://phabricator.services.mozilla.com/D257399
This new method collects less information and also does not need to lock
arenas to access their stats. It may be used on any thread.
The main thread only arenas thread-safety rules have become more complex and
I've added a comment to explain what is safe.
Differential Revision: https://phabricator.services.mozilla.com/D225942
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).
Differential Revision: https://phabricator.services.mozilla.com/D60635