David Carlier
55f1237df9
Few build tweaks.
2020-03-17 12:16:21 +00:00
David Carlier
2d4f2c3867
AAL, basic arm implementation proposal.
2020-03-13 08:09:14 +00:00
Amaury Chamayou
8e3efcb1dc
Assert not going through the PAL ( #140 )
...
* Assert not going through the PAL
* Make it more difficult to assert() accidentally
2020-03-11 15:58:44 +00:00
SchrodingerZhu
8077c66a8e
format bits
2020-03-08 22:50:34 +08:00
SchrodingerZhu
65de3c41bc
fix mingw
2020-03-08 22:13:49 +08:00
Amaury Chamayou
acbcbce597
replace assert with SNMALLOC_ASSERT
2020-03-04 16:57:44 +00:00
Matthew Parkinson
c9da18a145
Improve Debug test speed.
...
Removed some very expensive debug checks off the fast path
of deallocation.
2020-02-06 13:05:40 +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
Nathaniel Filardo
20e804728b
Move bits::is_aligned_block to address.h
...
And chase consequences
2019-11-26 15:33:09 +00:00
David Chisnall
d83828c537
[NFC] Appease clang-tidy.
2019-07-10 11:22:24 +01:00
David Chisnall
7eabea01d6
Add an Architecture Abstraction Layer.
...
Currently, we support one architecture, but this provides a layer for
adding other architectures without adding more nested `#ifdef`s.
Fixes #42
2019-07-10 10:42:59 +01:00
David Chisnall
e594377b8a
Pull out the #defines from bits.
2019-07-09 13:16:45 +01:00
Matthew Parkinson
54879fbb4a
Make GCC happy with inline
2019-07-02 15:38:28 +01:00
Matthew Parkinson
b74116e209
Fixes
2019-07-02 14:58:13 +01:00
Matthew Parkinson
eb4e28e8d0
CR Feedback
...
Removed stub from message queue, and use an actual allocation.
2019-07-02 14:08:05 +01:00
Matthew Parkinson
fdcbcf7016
Add prefetch to mpscq.
2019-07-02 14:07:42 +01:00
Matthew Parkinson
621b7e6b9a
Clang format.
2019-07-02 10:51:18 +01:00
Matthew Parkinson
3c7d122dea
Add macro for ASSUME and FAST_PATH/SLOW_PATH
...
Fixes GCC warning that was incorrect using an ASSUME.
Made fast path and slow path Macros so we can add additional attributes.
2019-07-01 14:35:36 +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
3c7582f717
Remove two unused functions.
2019-05-10 15:12:26 +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
840e00b430
Fix sign warning.
2019-04-30 14:08:41 +01:00
David Chisnall
8bd136c224
Remove all instances of static_cast<size_t>(1).
...
In preparation for removing magic numbers, simplify code that is
computing masks with a single bit set.
2019-04-30 11:50:32 +01:00
David Chisnall
5c197e4ae4
[NFC] More checks, comments on end of namespace braces.
2019-04-30 09:46:01 +01:00
David Chisnall
49ece8f4e1
Enable the static analyser from clang-tidy.
...
Fix a false positive. The loops in the pagemap accessor are too
complicated for the static analyser to check, so it doesn't spot that a
non-null return is impossible.
2019-04-30 09:46:01 +01:00
David Chisnall
d06e539732
Add more checks.
...
Add missing parentheses in UNUSED (shouldn't matter, but keeps a checker
that may catch real bugs elsewhere happy).
2019-04-30 09:46:01 +01:00
David Chisnall
28fac4d700
Fix the remaining clang-tidy warnings.
...
This introduces a new `address_t` type and two new casts: `pointer_cast`
and `address_cast` for casting between an `address_t` and a pointer.
These should make it easier to audit the codebase for casts between
pointers and integers. In particular, the remaining `reinterpret_cast`s
and `pointer_cast`s should be the only places where we could perform
invalid pointer arithmetic.
Also adds a `pointer_offset` helper that adds an offset (in bytes) to a
pointer, preserving its original type. This is a sufficiently common
pattern that it seemed worthwhile to centralise it.
2019-04-29 13:37:05 +01:00
David Chisnall
4bafca9be7
[NFC] Automatic fixes from clang-tidy.
2019-04-29 11:33:07 +01:00
Matthew Parkinson
4a0299ec77
Clang format
2019-04-29 11:02:47 +01:00
Matthew Parkinson
f1835813bd
uintptr_max instead of -1/~0
2019-04-29 11:02:47 +01:00
Matthew Parkinson
c471e1a271
CR
2019-04-29 11:02:47 +01:00
Matthew Parkinson
8eb6e36966
Add comment about min/max.
2019-04-29 11:02:47 +01:00
Matthew Parkinson
37afe9d079
Clang format
2019-04-29 11:02:47 +01:00
Matthew Parkinson
4faf9f3bee
Use fewer header files
...
Removing some includes to reduce the code that is dragged in.
2019-04-29 11:02:47 +01:00
Matthew Parkinson
ccccd686fb
Merge pull request #16 from Microsoft/Sizeclass
...
Simplified sizeclass calculations and added tests.
2019-02-19 13:07:08 +00:00
Matthew Parkinson
c02077a06a
Bug fix in umul code for 32-bit Win
2019-02-15 14:36:47 +00:00
Matthew Parkinson
e004641cec
Added to comment.
2019-02-11 14:47:12 +00:00
Matthew Parkinson
9981bad9b5
clang format
2019-02-11 14:47:12 +00:00
Matthew Parkinson
1272078487
Simplified size class calculation
...
The rounding code can be integrated directly into the sizeclass code,
which means, the code paths can be simplified slightly.
The special case for zero mantissa bits is not required, as the compiler
generates the same code from the more complex path due to
eliminating dead code after folding the constant zero through.
2019-02-11 14:47:12 +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