Commit Graph

6 Commits

Author SHA1 Message Date
Matthew Parkinson
923705e514 Natural alignment for USE_MALLOC (#248)
* Add concept of natural alignment to tests.

snmalloc naturally aligns blocks very heavily, so that
the largest power-of-two in the rounded size is the alignment.
This checks that in the test, and provides a method for
finding the natural alignment of a block.

* Improve USE_MALLOC to provide alignment

snmalloc provides a lot of alginment guarantees. This ensures that when
we pass through to the system allocator we still get those alignment
guarantees.

The commit also fixes the tests to work with USE_MALLOC, and builds a
set of unit tests for ctest to check behaviour.
2020-09-28 10:08:19 +01:00
Amaury Chamayou
acbcbce597 replace assert with SNMALLOC_ASSERT 2020-03-04 16:57:44 +00:00
Matthew Parkinson
16b084f501 Changed abort behaviour for Windows CI. 2019-08-13 15:37:54 +01:00
Matthew Parkinson
df1896d55f Improved ThreadAlloc::get API
Made the API so that get always returns an initialised Alloc*.  Added
new fast path that doesn't perform checking, but can lead to very slow
behaviour if called and reused.
2019-07-15 15:02:47 +01:00
David Chisnall
829d8e856b Tweak some tests to avoid the slowest path.
By caching the result of the first call to ThreadAlloc::get(), we were
always hitting a code path that should be hit once per thread in normal
operation.
2019-07-05 09:42:01 +01:00
Matthew Parkinson
4f9d991449 Initial commit of snmalloc
History squashed from internal development.

Internal history has commit hash:
  e27a0e485c44a5003a802de2661ce3b21e120316
2019-01-15 14:17:55 +00:00