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

1196 Коммитов

Автор SHA1 Сообщение Дата
Matthew Parkinson fb825dde09 Add an assert. 2019-07-01 14:35:35 +01:00
Matthew Parkinson 7a198cbda5 Aggressively optimise fast path for allocation
This change introduces a per small sizeclass free list.  That can be
used to access the free objects for that sizeclass with minimal
calculations being required.

It changes to a partial bump ptr.  We bump allocate a whole OS
page worth of objects at a go, so we don't switch as frequently
between bump and free list allocation.

The code for the fast paths has been restructured to minimise the
work required on the common case, and also it is all inlined for the
common case.

Allocating a zero sized object is moved off the fast path.  Ask for 1
byte if you want to be fast.
2019-07-01 14:35:35 +01:00
Matthew Parkinson b0c1531221 Improved fast path for pagemap. 2019-07-01 14:35:35 +01:00
Matthew Parkinson 7f7704b6fc Made a size to sizeclass table. 2019-07-01 14:35:34 +01:00
Matthew Parkinson 7a8eaec2cc Made a sizecass_t to wrap the sizeclass
This is useful as codegen is nicer if we use size_t, but the semantics
is uint8_t, and is stored as that in many places in the metadata.
Ultimately should introduce a wrapper to check this invariant.
2019-07-01 14:30:05 +01:00
Matthew Parkinson 830b06a616 Add a couple of likely annotations. 2019-07-01 14:24:03 +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 bb6b8e45c2
Merge pull request #61 from ricleite/readme_fix
Minor typo fixes in README
2019-06-27 17:49:15 +01:00
Ricardo Leite ace91c7b2a Minor typo fixes in README 2019-06-27 16:45:06 +01:00
Matthew Parkinson b033587ce8
Merge pull request #60 from microsoft/detect_cooruption
A few checks for easy corruptions
2019-06-12 16:14:43 +01:00
Matthew Parkinson cc6a9775d6 Made checks on client have own macro. 2019-06-12 15:29:25 +01:00
Matthew Parkinson 7153f2169c Reverting separate compilation of new.cc. 2019-06-12 15:04:25 +01:00
Matthew Parkinson be1898c4e8 Fixed warning. 2019-06-12 14:12:47 +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
Matthew Parkinson 88d9534453 CR Feedback + clangformat 2019-06-12 13:54:14 +01:00
Matthew Parkinson a8dd065fd7 A few checks for easy corruptions
Will detect corruption caused by either
* Use-after-free
* Double-free
Neither is comprehensive.  Full temporal safety is not possible.
This just aids with debugging.
2019-06-06 13:31:25 +01:00
Matthew Parkinson 9ca436c951
Merge pull request #59 from plietar/paper
Add paper.
2019-05-23 19:24:58 +01:00
Paul Liétar 37d8fcf47b Add link to difference.md from README 2019-05-23 18:49:19 +01:00
Paul Liétar d7bac272fd Fix spelling 2019-05-23 15:16:16 +01:00
Paul Liétar 0d110e93af Add paper. 2019-05-23 15:13:47 +01:00
Matthew Parkinson 2ee752527d
Merge pull request #53 from microsoft/new_link
Used start of a slab for link.
2019-05-21 17:32:24 +01:00
Matthew Parkinson ef18d7d8d5 Made initialization of slab clearer. 2019-05-21 15:25:33 +01:00
Matthew Parkinson 7de46182a8 Used start of a slab for link. 2019-05-21 09:47:23 +01:00
Matthew Parkinson 17bbab4fe4
Merge pull request #57 from Theodus/ci
Reduce duplication in Azure Pipelines CI script
2019-05-18 19:04:18 +01:00
Theo Butler fd4d88ecc1 fix Windows build type 2019-05-18 13:00:25 +02:00
Theo Butler 070e0700a8 use clangformat cmake target 2019-05-18 12:54:35 +02:00
Theo Butler f9b9523d0c add ld preload build to linux matrix 2019-05-18 11:07:50 +02:00
Theo Butler f5000c087f merge clang and gcc build into one matrix 2019-05-18 10:38:41 +02:00
Matthew Parkinson bcfc60f3e6
Merge pull request #48 from ashamis/add_to_readme
Add instructions on how to use the header-only library
2019-05-17 16:03:10 +01:00
Alex Shamis e326d84e05 Add instructions on how to use the read-only library 2019-05-17 13:39:03 +01:00
Matthew Parkinson a2dea6cf1d
Merge pull request #55 from Theodus/ci
Install g++7 for Linux-gcc CI
2019-05-16 21:35:00 +01:00
Theo Butler 54f219c902 Install g++7 for Linux-gcc CI 2019-05-16 20:35:04 +02:00
Matthew Parkinson 6be7e0d842
Merge pull request #54 from microsoft/stats_atexit
Made the statistics print atexit
2019-05-16 14:51:30 +01:00
Matthew Parkinson b8bcfc0798 Made the statistics print atexit
Fixed some statistics and made them automatically print atexit.
2019-05-16 11:43:44 +01:00
Matthew Parkinson 48416e3241 CR Feedback 2019-05-14 21:16:11 +01:00
Matthew Parkinson b484619f20 Added branch predictor hint. 2019-05-14 21:16:11 +01:00
Matthew Parkinson 5d711a2e65 Made checking debug only 2019-05-14 21:16:11 +01:00
Matthew Parkinson e5d617c5fb Improve TLS performance
Refactor fast and slow paths to improve inlining
and codegen.
2019-05-14 21:16:11 +01:00
Matthew Parkinson 3c7582f717 Remove two unused functions. 2019-05-10 15:12:26 +01: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 b38c36b40f Added a fflush to the error message. 2019-05-08 17:56:48 +01:00
Matthew Parkinson 3c9fe1041a
Added error message to Windows Pal using VirtualAlloc. (#44) 2019-05-08 17:10:53 +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
David Chisnall 0b64536be4
Merge pull request #39 from Microsoft/clang-tidy-ci
Add clang-tidy to CI.
2019-04-30 10:22:13 -04:00
David Chisnall d978b7a68f Apply clang-tidy checks to the Linux build. 2019-04-30 15:06:45 +01:00
David Chisnall d259a87d03 Make clang-tidy fail when it ought to.
clang-tidy exits with an error code of 0 if the code compiles, even if
there are warnings.  Make it generate a file with the errors and fail
the test if this file exists.

Also remove the -fix flag - we don't want clang-tidy to fix things in CI
(yet?).
2019-04-30 15:02:55 +01:00
David Chisnall 4f8c7ba258 Add clang-tidy to CI. 2019-04-30 14:52:19 +01:00
David Chisnall 747063db87
Merge pull request #38 from Microsoft/clang-tidy
Clang tidy
2019-04-30 09:41:12 -04:00