Граф коммитов

65 Коммитов

Автор SHA1 Сообщение Дата
David Chisnall 2ee3ba59ee Use VirtualAlloc2 on Windows.
The newer API (Windows 10 and newer) allows the allocator to ask for
strongly aligned memory.

This is enabled only if the `WINVER` macro is set to target Windows 10
or newer.  There is now a CMake option to target older versions of
Windows, so we can test both code paths.

The Azure Pipelines config now includes a test of the compatibility
version.  This runs only the release build, because it's mainly there as
a sanity check - 99% of the code is the same as the default Windows
config.
2019-02-20 17:36:39 +01:00
Paul Liétar ffe496dd18 Address review comments. 2019-02-18 21:29:32 +00:00
Paul Liétar 66400af419 Add a cache-friendly version of the tests.
This only tests CACHE_FRIENDLY_OFFSET=64, which is probably what we'll be using in the end.
2019-02-18 14:51:04 +00:00
Paul Liétar 4ac3421487 Place the next pointer at a different place on every object.
This limits the collision in cache buckets, especially for larger objects.
2019-02-18 14:22:50 +00:00
Matthew Parkinson e7d90966f6 Made the malloc tests run on Windows 2019-02-15 14:36:47 +00:00
Theo Butler d2909eed0a Merge branch 'master' into malloc-tests 2019-02-14 22:30:48 -05:00
Theo Butler 0ff2301083 use malloc shim in malloc tests 2019-02-13 08:12:07 -05:00
Theo Butler e42551bb15 only build malloc tests on POSIX platforms 2019-02-12 22:05:36 -05:00
Paul Liétar 8d8761f248 Make internal symbols hidden.
Only the malloc/free/... interface is exported.

This allows all of C++'s weak ODR symbols to be resolved at
compile-time, rather than staying weak and resolved at load-time.

Since internal calls don't need to go through the PLT anymore, we get a
nice speedup, at least on small objects.
2019-02-12 23:27:42 +00:00
David Chisnall ccd8ec9b4f Disable rtti / exceptions on the non-Windows builds.
RTTI makes the binaries bigger, exceptions make life harder for
optimisers.  Neither are actually used.

This doesn't preclude anything #including snmalloc.h with RTTI enabled,
it just disables it in the shim libraries and tests.

The FreeBSD libc builds were already doing this with no ill effect.
2019-02-06 17:46:58 +00:00
Matthew Parkinson 2cd84c80b2 Build shim with 1MiB superslabs. 2019-02-06 17:08:47 +00:00
Matthew Parkinson 1d5df3b7a9 Build both 1MiB and 16MiB tests 2019-01-22 11:19:57 +00:00
Matthew Parkinson 62ad70b17e Fixes to remote deallocation
The encoding in the top bits for the size class did not respect kernel
pointers.  Using an intptr_t means, we can use a signed shift to
maintain the kernel pointers.
2019-01-18 14:30:23 +00:00
Matthew Parkinson 4748f25e57 Removing warnings from Windows Ninja configuration
Windows Ninja build was complaining about /W4 and /W3 being
specified, and C++ latest and C++ 17.  This fixs those complaints.
2019-01-17 18:23:06 +00: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