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

65 Коммитов

Автор SHA1 Сообщение Дата
Matthew Parkinson e393ac882f New configuration of slab sizes for OE. 2020-06-18 13:09:06 +01:00
Matthew Parkinson 4c22c5b02f
Make binaries more compatible by default (#206)
* Make binaries more compatible by default

Turn `-march=native` off by default. This makes binaries more portable,
but may harm performance. However, fast paths look unaltered

* Change setting to on if specified.
2020-05-28 16:56:48 +01:00
Amaury Chamayou 7ccd6c36e8
Fix clang-format lookup to do what the comment says (#197) 2020-05-21 17:11:01 +01:00
SchrodingerZhu 497f9d9386
add static library (#189)
* add static library

* leave static library on by default

* fix 1mib layout

* code reviews
2020-05-19 06:46:40 +01:00
Nathaniel Wesley Filardo 6dae830ea0
Use cmake to find backtrace() (#187)
On FreeBSD, this notably requires the use of -lexecinfo, as backtrace()
is not available in -lc.  Rather than testing in C, test in cmake.
2020-05-16 12:45:51 +01:00
Matthew Parkinson 79ca9bdd9d
Default build to Release. (#177) 2020-05-06 18:24:45 +01:00
SchrodingerZhu a43773c5b7
add android support (#171)
* adjust for android

* update docs

* add const qualifier to `alloc_size`

* check const qualifier in cmake
2020-04-18 07:58:13 +01:00
Matthew Parkinson 47547c4f66 Re-enable GCC warning. 2020-04-14 11:39:00 +01:00
Matthew Parkinson 89ad538ccc Disable GCC warning. 2020-04-13 08:33:52 +01:00
Matthew Parkinson 74657d9dbc
Defensive code for alloc/dealloc during TLS teardown (#161)
* Defensive code for alloc/dealloc during TLS teardown

If an allocation or deallocation occurs during TLS teardown, then it is
possible for a new allocator to be created and then this is leaked. On
the mimalloc-bench mstressN benchmark this was observed leading to a
large memory leak.

This fix, detects if we are in the TLS teardown phase, and if so,
the calls to alloc or dealloc must return the allocator once they have
perform the specific operation.

Uses a separate variable to represent if a thread_local's destructor has
run already.  This is used to detect thread teardown to put the
allocator into a special slow path to avoid leaks.

* Added some printing first operation to track progress

* Improve error messages on posix

Flush errors, print assert details, and present stack traces.

* Detect incorrect use of pool.

* Clang format.

* Replace broken LL/SC implementation

LL/SC implementation was broken, this replaces it with
a locking implementation. Changes the API to support LL/SC
for future implementation on ARM.

* Improve TLS teardown.

* Make std::function fully inlined.

* Factor out PALLinux stack trace.

* Add checks for leaking allocators.

* Add release build of Windows Clang
2020-04-07 15:37:26 +01:00
Amaury Chamayou 60861eef44
CI for both arms (#151)
* Add another ARM
2020-03-20 09:17:38 +00:00
Matthew Parkinson 4246d9a065
Workaround for QEMU behaviour. (#147)
* Fixes for ARM

* Workaround for QEMU behaviour.
2020-03-19 12:37:44 +00:00
David Carlier 55f1237df9 Few build tweaks. 2020-03-17 12:16:21 +00:00
David Carlier e7f020cf76 implementations moved on the composer class. 2020-03-13 15:39:49 +00:00
David Carlier 2d4f2c3867 AAL, basic arm implementation proposal. 2020-03-13 08:09:14 +00:00
SchrodingerZhu 65de3c41bc fix mingw 2020-03-08 22:13:49 +08:00
Matthew Parkinson cae3317964 Update to use clangformat9
With clangformat9 the AfterCaseLabel is introduced.
And this defaults to false, but our code is formatted
implicitly with this set to true.

PRs to Verona and Snmalloc are being formatted with clangformat9,
and this is causing complexity. Let's move forward to clangformat9
in CI.
2020-02-06 09:09:32 +00:00
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