David Chisnall
54cbf8b2bb
[NFC] Remove unused headers from OpenBSD PAL.
2019-08-01 11:21:28 +01:00
David Chisnall
0497993d23
Fix typo in OpenBSD PAL.
2019-08-01 11:20:05 +01:00
David Chisnall
d257f60731
[NFC] Add missing doc comments.
2019-08-01 11:03:22 +01:00
David Chisnall
4ed15def79
[NFC] Remove some code duplication in the PALs.
...
Pull out a generic POSIX PAL as a superclass for the Linux and generic
BSD PALs. Now we have FreeBSD and Linux adding OS-specific behaviour,
OpenBSD as a named subclass of the generic BSD PAL that doesn't add any
behaviour.
I believe a NetBSD PAL should now be identical to the OpenBSD one -
patches welcome if anyone wants to test one!
2019-08-01 10:56:13 +01:00
David Chisnall
5c22521ea1
Merge pull request #74 from devnexen/openbsd_support
...
Basic OpenBSD backend support.
2019-08-01 09:19:53 +01:00
David Carlier
fdae3b451f
Creating base class instead used by both platforms.
2019-07-31 10:27:35 +00:00
David Carlier
6b4ff3e7ab
Basic OpenBSD backend support.
...
Cannot enforce alignment so we just check its correctness.
2019-07-30 20:58:38 +01:00
Paul Liétar
c1a7197dd8
Merge pull request #73 from plietar/get_noncachable
...
Use get_noncachable in malloc/new overrides.
2019-07-17 16:13:17 +01:00
Paul Liétar
b2b86565db
Use get_noncachable in malloc/new overrides.
...
This may return the GlobalPlaceholder, in which case the slow path will
be used, initializing the real thread local allocator.
2019-07-17 15:41:45 +01:00
Paul Liétar
242f51eaaa
Merge pull request #72 from plietar/find-bug
...
Add remove_cache_friendly_offset calls in a few places that were missing it.
2019-07-17 14:51:23 +01:00
Paul Liétar
7047cda8ed
Fix warning about shadowing.
2019-07-17 14:13:44 +01:00
Paul Liétar
b185337c07
Specify a CMakeArgs for every matrix entry.
2019-07-17 13:54:56 +01:00
Paul Liétar
e87d184926
Remove $(CMakeOptions) that was leftover by accident.
2019-07-17 13:51:24 +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
ab8ec72738
Merge pull request #71 from microsoft/tls-2
...
Improved ThreadAlloc::get API
2019-07-16 11:25:27 +01:00
David Chisnall
d3f5dcefe4
Fix the libc hook.
...
Friend declarations to `extern "C"` functions must have a forward
declaration with the correct signature.
2019-07-16 10:55:29 +01:00
Matthew Parkinson
a2a47d9a50
Clang-tidy
2019-07-15 20:08:16 +01:00
Matthew Parkinson
1b0923e141
Clang-tidy
2019-07-15 19:51:11 +01:00
Matthew Parkinson
280c2ae25c
Refactor ThreadAlloc
...
Made common code between the Libc and C++ based releasing of allocators
part of a parent class, which each implementation subclasses.
2019-07-15 17:49:40 +01:00
David Chisnall
89a296aaaa
Merge pull request #70 from microsoft/pagemap-splice
...
Add two APIs that are missing from the flat pagemap.
2019-07-15 15:11:09 +01:00
Matthew Parkinson
df1896d55f
Improved ThreadAlloc::get API
...
Made the API so that get always returns an initialised Alloc*. Added
new fast path that doesn't perform checking, but can lead to very slow
behaviour if called and reused.
2019-07-15 15:02:47 +01:00
David Chisnall
5e9727c8ca
[NFC] clang format.
2019-07-15 15:01:45 +01:00
David Chisnall
31267f9d85
Add two APIs that are missing from the flat pagemap.
2019-07-15 13:39:03 +01:00
Matthew Parkinson
4ce371f936
Tidy TLS implementation.
2019-07-12 16:45:04 +01:00
Matthew Parkinson
4a95de4e8d
Merge pull request #68 from microsoft/minor_opts
...
Minor opts
2019-07-11 09:17:48 +01:00
Matthew Parkinson
c1c9237b8d
Handle 32bit to not allocate way to mcuch.
2019-07-10 20:11:06 +01:00
Matthew Parkinson
c2785ec661
Reduce test size.
2019-07-10 20:11:05 +01:00
Matthew Parkinson
33ff935aee
Remove infinite loop from adding message queue check
...
Adding a handle_message_queue here lead to an infinite loop.
2019-07-10 20:11:05 +01:00
Matthew Parkinson
45f47499c5
Improved pal_supports
2019-07-10 20:11:05 +01:00
Matthew Parkinson
23b3e35d6e
Add comment about inlining choices.
2019-07-10 20:11:04 +01:00
Matthew Parkinson
c6178322b0
Minor
2019-07-10 20:11:04 +01:00
Matthew Parkinson
9fd238d5fa
Move remote dealloc to slow path
...
It is only ever called in a tail position, so slow path means it is just
a jump, but improves the local deallocation fast path's codegen
considerably.
2019-07-10 20:11:04 +01:00
Matthew Parkinson
e240dd279a
Use FlatPageMap on OS with lazy commit
...
If the operating system will allocate private pages on demand for the
pagemap then use the FlatPageMap by default as it generates better code
for deallocation.
2019-07-10 20:11:03 +01:00
David Chisnall
1e3f95152e
Merge pull request #69 from microsoft/aal
...
Aal
2019-07-10 18:36:42 +01:00
David Chisnall
bc34e5abe5
Reduce parallelism on the Win8Compat CI job
...
This version doesn't get to perform aligned allocations and so can
consume a lot more memory than the other modes.
2019-07-10 11:50:20 +01:00
David Chisnall
d83828c537
[NFC] Appease clang-tidy.
2019-07-10 11:22:24 +01:00
David Chisnall
ccaae50dd4
Explicitly include cstdint in the AAL.
...
This is not necessary with libc++ platforms because of some header
pollution, but is necessary everywhere else.
2019-07-10 11:05:55 +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
David Chisnall
c35a3941fe
Merge pull request #65 from microsoft/queue_of_slabs
...
Use a queue of slabs for free lists
2019-07-08 20:53:06 +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
3a0cdc05a5
Fix on macOS.
...
Fixes an issue where the global placeholder allocator was being
released.
2019-07-08 19:24:56 +01:00
Matthew Parkinson
d1db6d07ad
Use a queue of slabs for free lists
...
This commit changes the strategy for finding a free list from
a stack to a queue. This tends to avoid the slow path considerably more.
It has some memory overheads.
TOOD: We should move the bump allocation data out of the metaslab and
into the allocator. At the moment, the slab contains the bump allocation
data, we should move this into the allocator, as it only ever has one slab
it is bump allocating from per sizeclass.
2019-07-05 17:04:55 +01:00
David Chisnall
8d216dca3e
Remove accidentally committed line.
2019-07-05 17:01:35 +01:00
David Chisnall
2efcddfc3d
Rework free list so that 0 is the placeholder.
...
This is needed because in some configurations the constructor for the
global placeholder is not called before the first allocation (i.e. when
other globals call the allocator in their constructor) and so we ended
up following a null pointer.
2019-07-05 14:20:24 +01:00
David Chisnall
14b5c57b55
Fix all of the tests.
2019-07-05 13:24:28 +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
50695d07f8
Disable an always_inline with GCC in debug mode.
...
Most compilers are happy if you say always-inline but they can't. GCC
will complain. Here, we have two mutually recursive functions that are
marked as always inline. In an optimised build, one is inlined into the
other and then becomes a tail-recursive function that should inline the
tail call. Inlining the tail call can be done by simply jumping to the
start of the function and so everything is fine. In a debug build, the
second transform doesn't happen and so we're left with a call to an
always-inline function.
2019-07-05 11:39:14 +01:00
David Chisnall
eefc9e49c5
Fix some duplicate inline warnings.
2019-07-05 11:39:01 +01:00
David Chisnall
1e65aafa06
Add missing fast-path annotations.
2019-07-05 09:42:07 +01:00