Commit Graph

26 Commits

Author SHA1 Message Date
David Chisnall
2385eb2bc1 Separate out building and porting docs. (#260)
Fix omissions in the porting doc (`page_size` and C++20 concepts).
2020-11-10 13:33:45 +00:00
Nathaniel Filardo
17d5a3ed20 Update README.md PAL discussion w/ sprinkled "static" 2020-09-09 12:55:48 +01:00
David Chisnall
5199556263 Reduce code duplication. (#220)
* Reduce code duplication.

The Apple and Haiku PALs both had *almost* identical code to the POSIX
PAL, differing only in some small argument variables.  This is fragile
and easy to accidentally get out of sync.  For example, the changes to
`reserve_at_least` involved copying identical code into multiple PALs
and it's easy to accidentally miss one.

This change introduces two optional fields on POSIX-derived PALs:

 - `default_mmap_flags` allows a PAL to provide additional `MAP_*`
   flags to all `mmap` calls.
 - `anonymous_memory_fd` allows the PAL to override the default file
   descriptor used for memory mappings.

If a PAL does not provide these, default values are used.

Fixes #219
2020-06-30 13:33:50 +01:00
Matthew Parkinson
e16f2aff6f Add AddressSpaceManager (#214)
This change brings in a new approach to managing address space.
It wraps the Pal with a power of two reservation system, that
guarantees all returned blocks are naturally aligned to their size. It
either lets the Pal perform aligned requests, or over allocates and
splits into power of two blocks.
2020-06-22 12:36:40 +01:00
Matthew Parkinson
87dfd41553 Improve code quality for alloc_size (#196)
* Improve code quality for alloc_size

* Made error noreturn.

* Update docs.

* Move annoation
2020-05-23 16:16:12 +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
Alex
0a081cacd6 Readme update (#153) 2020-03-22 07:25:27 +00:00
Matthew Parkinson
040c878c6e Update documentation
The readme was considerably out of date, with the introduction
being over a year old.  This commit reflects the developments and
improvements in stabiity of snmalloc.
2020-02-28 09:03:41 +00:00
Matthew Parkinson
4fea7b8bb1 Make Pals only return amount of memory requested
The PAL API previously allowed for returning more memory than asked for.
This was when the PAL performed the alignment work, now this is done in
large alloc, so removing from the PAL.
2020-02-04 10:19:22 +00:00
Matthew Parkinson
6e8edefc99 Make all large allocations naturally aligned
This makes any large allocation naturally aligned to its size. This
means all alignment requests can be handled without checks.
2020-02-04 10:19:22 +00:00
Paul Liétar
bb33406fe2 Remove upper case letter from middle of sentence 2020-01-14 02:23:23 +00:00
David Chisnall
6dbe24da2e [NFC] Replace HEADER_GLOBAL with inline (C++17).
HEADER_GLOBAL was using non-standard attributes to achieve what C++17
now permits with a keyword.  Use the standard formulation.

Update the README to note that gcc is still not recommended, but because
of its poor codegen for 128-bit atomic compare and exchange, rather than
because it doesn't support the attribute used for HEADER_GLOBAL.
2019-08-13 17:30:37 +01:00
David Chisnall
9dec0916aa [NFC] Add NetBSD note, missing noexcept. 2019-08-02 12:26:29 +01:00
David Chisnall
b2a1f43514 [NFC] Fix typos. 2019-08-02 12:18:42 +01:00
David Chisnall
e310b49b54 [NFC] Update README to discuss porting. 2019-08-02 12:17:00 +01:00
Ricardo Leite
ace91c7b2a Minor typo fixes in README 2019-06-27 16:45:06 +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
Alex Shamis
e326d84e05 Add instructions on how to use the read-only library 2019-05-17 13:39:03 +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
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
7f576c74d6 Update docs to mention macOS. 2019-02-25 16:33:57 +00:00
Matthew Parkinson
cf8699df4f Update README.md
Added a build badge
2019-01-16 17:19:22 +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
Microsoft Open Source
e488c24784 Initial commit 2019-01-09 06:05:58 -08:00