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

98 Коммитов

Автор SHA1 Сообщение Дата
Matthew Parkinson de64a8c0c2 CF and Add checks to CI. 2020-02-05 13:41:49 +00:00
Matthew Parkinson 28658a47f0 Code review feedback. 2020-02-05 12:47:24 +00:00
Paul Liétar 7e22d302ad Don't use our own loop to find clang-format
find_program can do that for us. Additionally that loop was resetting
the CLANG_FORMAT every time ninja was run, making it impossible to
pass a specific -DCLANG_FORMAT=... to cmake.

I've tried version 6 to 8 and formatting remains stable. clang 9 is
when it breaks down because of AfterCaseLabel.
2020-01-31 08:04:36 +00:00
Matthew Parkinson 0affc069cf Make snmalloc build on Windows with Clang
Fixes a few places where Clang complains about Windows specific code,
and also uses macros supported by Clang on Windows.  A few places
separating platform and compiler specific code, as MSVC and WIN32 were
used interchangably previously.
2020-01-26 19:46:18 +00:00
SchrodingerZhu 8304dedd17 add rust support (#113)
* add rust support

* move aligned_size to sizeclass.h

* add static qualifier

* adjust CMakeLists.txt, may broke CI tests

* fix msvc's complaining on c++17

* use SNMALLOC_FAST_PATH as the decorator of aligned_size

* adapt new alignment algorithm and add related test

Co-authored-by: mjp41 <mattpark@microsoft.com>

* fix test cases for msvc

* add extra test for size == 0

* treat memory block of same sizeclass as the same

* fix formatting problem

* remove extra declarations

Co-authored-by: Matthew Parkinson <mjp41@users.noreply.github.com>
2020-01-23 07:08:18 +00:00
David Carlier 9da3261a22 atomic swap 16 flag missing fix.
In some platforms, it is rather amd64 than the more common x86_64,
thus missing to rightfully set this flag.
2019-11-28 09:30:43 +00:00
Nathaniel Filardo 00268fc2ad -Wundef 2019-11-26 14:59:54 +00:00
Nathaniel Filardo 9cdac05e4d portability: platform compiler flags
-mcx16 and -march=native are platform specific.  Leave them out if we
aren't targeting chips that need it.
2019-11-26 14:59:54 +00:00
Nathaniel Filardo 10475f3432 Set linker-language C; prevents linking c++ stdlib
Thanks to Alex Richardson for the suggestion
2019-11-26 14:58:08 +00:00
Nathaniel Filardo 528215e45e clangformat 8 2019-11-26 14:58:08 +00:00
Matthew Parkinson 9eaadcd6d8 Reduce parallism in tests
If some tests on Windows are co-scheduled, then they run out of commit
space and crash. For example, in func-memory,
test_external_pointer_large can cause the small CI machines to run out
of commit space on Windows.
2019-08-15 10:50:54 +01:00
Matthew Parkinson 16b084f501 Changed abort behaviour for Windows CI. 2019-08-13 15:37:54 +01:00
Matthew Parkinson 2ab4bb4366 Remove new from examples as they don't use it. 2019-08-13 13:04:29 +01:00
Matthew Parkinson 96c4acd5dd Make all functional tests use statistics. 2019-08-13 13:03:06 +01:00
Paul Liétar a5379b24d5 Add remove_cache_friendly_offset calls in a few places that were missing it. 2019-07-17 13:14:59 +01:00
David Chisnall 97bfa68258
Merge pull request #64 from microsoft/lazy_tls
Lazy tls
2019-07-08 20:52:08 +01:00
David Chisnall a40c71f68e Bump the perf tests up to counting as 4 tests.
They're failing on macOS and 32-bit Windows CI, but not locally on
32-bit Windows, so probably running out of memory...
2019-07-05 13:03:58 +01:00
David Chisnall 6eeb273cbd Add -fomit-frame-pointer to CMakeLists for optimised builds. 2019-07-05 09:42:07 +01:00
Matthew Parkinson daebe3f5e5 Remove constexpr steps. 2019-07-02 14:07:13 +01:00
Matthew Parkinson d4e94d9c49 Minor changes to mpscq fast path. 2019-07-02 14:07:13 +01:00
Matthew Parkinson 7f7704b6fc Made a size to sizeclass table. 2019-07-01 14:35:34 +01:00
Matthew Parkinson 90a0274743 Made TLS initial Exec.
This massively improves the TLS access at the expense of not being
dynamically loadable.
2019-07-01 14:24:03 +01:00
Matthew Parkinson 7153f2169c Reverting separate compilation of new.cc. 2019-06-12 15:04:25 +01:00
Matthew Parkinson d23a1ccbdf Make clangformat a macro to allow sharing. 2019-06-12 14:06:20 +01:00
Matthew Parkinson 5817978388 Make new.cc only compile once
Each test was compiling new.cc for every go.  This optimises that to
just compile it once.
2019-06-12 14:05:02 +01:00
Theo Butler 070e0700a8 use clangformat cmake target 2019-05-18 12:54:35 +02:00
Matthew Parkinson 1e4eb3dea3
CMake Header-Only Target (#46)
Make header only library target. 

Use the CMake INTERFACE target type to include the build settings for
snmalloc in other projects using headers only.

Made warnings setting a macro for reuse.
2019-05-09 12:32:32 +01:00
Matthew Parkinson 8d5432c559
Expensive test property. (#43)
Make expensive tests run sequentially to prevent possible out-of-memory issues.
2019-05-08 15:51:41 +01:00
Matthew Parkinson 8fcedfc290
Fix the GCC build (#40)
* Make it compile with GCC.  
* Add GCC to CI.
* Add warning to documentation about using GCC.
2019-05-05 19:58:37 +01:00
Roy Schuster 29e4bdd29d Splitting EXPOSE_EXTERNAL_ALLOCATOR_API to EXPOSE_EXTERNAL_PAGEMAP and EXPOSE_EXTERNAL_RESERVE. Only the shim can be affected by passing the new pre-processor definitions to cmake. 2019-04-12 12:32:37 +01:00
Roy Schuster ebc1dab1cf Passing the EXPOSE_SHARED_ALLOCATOR argument to cmake will now expose the external allocator and pagemap sharing API 2019-04-12 09:51:52 +01:00
David Chisnall 869b22b422 Sort test order so that perf tests start first.
These take longer, so we want to start them earlier and let the shorter
tests fill in the gaps in scheduling.
2019-02-25 16:33:57 +00:00
David Chisnall ef50a0282b Attempt to make CI faster.
- Don't run an expensive functionality test in debug builds.
- Don't run the different cache configurations (they're probably going
  away soon because they help only in synthetic benchmarks).
2019-02-25 16:33:57 +00:00
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