Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add LoongArch aal #399

Closed
wants to merge 308 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
308 commits
Select commit Hold shift + click to select a range
935f3cc
Improved support for MSVC with C++17
ihaller Aug 26, 2021
b84a7af
Merge pull request #381 from ihaller/ihaller/msvc17
ihaller Aug 26, 2021
0f70494
Enable passthrough to an underlying allocator
mjp41 Aug 26, 2021
44416ed
Factor sizeclass meta-data for cache locality
mjp41 Aug 25, 2021
27c4a6a
Make pagemap check for init on some gets.
mjp41 Aug 25, 2021
7eb8769
Fix codegen for dealloc
mjp41 Aug 25, 2021
70c3e00
AddressSpace: use Backend to access Pagemap
nwf-msr Aug 20, 2021
f913f8b
Rename [gs]et_meta_data to [gs]et_metaentry.
nwf-msr Aug 24, 2021
3c14a7d
NFC: Concepts and fixed-pointing interact poorly
nwf-msr Aug 23, 2021
2e1658f
NFC: Make config objects expose their PoolState types
nwf-msr Aug 23, 2021
bb6e706
NFC: Add Concept for equality modulo references
nwf-msr Aug 24, 2021
e530f56
NFC: Add a concept for backend Global objects
nwf-msr Aug 23, 2021
2be44d2
Use backend global concept on template args
nwf-msr Aug 23, 2021
3710e35
Move BackendAllocator::pagemap closer to use
nwf-msr Aug 24, 2021
3af9d35
Plumb LocalState ptrs through to Pagemap accessors
nwf-msr Aug 24, 2021
aedb666
Added constness to argv in Opt (#383)
ihaller Aug 31, 2021
c70c23a
CMake cleanup. (#384)
davidchisnall Sep 3, 2021
dac1ba6
Metaslab: SlabLink field rather than parent class
nwf-msr Aug 29, 2021
fd18528
Add missing `inline` from header. (#388)
davidchisnall Sep 7, 2021
6c5626f
Install test headers.
davidchisnall Sep 6, 2021
d524ef5
Extracted the core elements of the BackendAllocator into a common hel…
ihaller Sep 14, 2021
51e75bc
Add memcpy with bounds checks.
davidchisnall Aug 10, 2021
7f71f80
Add compiler abstractions over fast fail. (#392)
davidchisnall Sep 20, 2021
1baf675
PALNoAlloc should delegate more to underlying PAL
nwf-msr Jul 21, 2021
4a4ca96
Prepare for AAL bits / address_bits
nwf-msr Jul 21, 2021
e212ddd
Prepare for PAL address_bits
nwf-msr Jul 21, 2021
15e3052
Move to AAL/PAL bits and address_bits
nwf-msr Jul 21, 2021
0af1ee3
Tidy TODOs from Free List
mjp41 Aug 13, 2021
b4efc40
Expose notify_using_readonly
mjp41 Sep 23, 2021
55a7ad2
Introduce PalEnforceAccess
mjp41 Sep 27, 2021
dbb7965
Minor.
mjp41 Sep 28, 2021
8ac2adc
Added a sequential queue
mjp41 Sep 29, 2021
bba66e4
Randomise slab filling (#397)
mjp41 Oct 7, 2021
6470d62
Fix teardown for main thread when using pthread destructors.
mjp41 Oct 7, 2021
73ebb69
localcache: drop some useless snmalloc:: namespace qualifiers
nwf-msr Sep 26, 2021
3109ae9
NFC: Accumulated nits in comments
nwf-msr Sep 28, 2021
b573906
address_cast SNMALLOC_FAST_PATH
nwf-msr Oct 13, 2021
9065893
Overhaul CapPtr
nwf-msr Jul 19, 2021
ca70856
CapPtr: remove a stale static assert
nwf-msr Aug 16, 2021
d76f5fd
NFC: CapPtr: Introduce "Tame"/"Wild" split
nwf-msr Aug 16, 2021
e25db7b
Move to FreeObject::T<capptr::bound<>>
nwf-msr Sep 17, 2021
06e333a
NFC: FreeObject: shift readers to take domestication callbacks
nwf-msr Sep 28, 2021
55cd5e8
NFC: Add FreeObject::from_next_ptr
nwf-msr Sep 21, 2021
7e53a2e
CapPtr: shift free lists to Alloc bounds
nwf-msr Sep 21, 2021
1a608e6
NFC: Introduce pointer domestication backend support
nwf-msr Aug 16, 2021
a34b7a5
Make capptr_from_client return a Wild CapPtr
nwf-msr Aug 16, 2021
7750676
NFC: FreeListIter domestication plumbing
nwf-msr Sep 13, 2021
d4c120d
Free queues hold Wild pointers
nwf-msr Sep 14, 2021
94ab856
NFC: remote queue domestication plumbing
nwf-msr Sep 14, 2021
501c146
Remote queues hold Wild pointers
nwf-msr Sep 28, 2021
7deb3b6
Fix builds on MSVC 2016
nwf-msr Oct 6, 2021
bc365e0
Default template args for FreeObject & friends
nwf-msr Oct 8, 2021
96155db
Collect freelist things in a namespace
nwf-msr Oct 8, 2021
97950a9
Optionally consider RemoteAllocator heads Tame
nwf-msr Oct 12, 2021
2316a5c
Add minimal domestication test
nwf-msr Oct 12, 2021
ed10717
RemoteAllocator: dequeue as destructive iterator
nwf-msr Oct 13, 2021
93bb037
Fixed bounds calculation for domestication
mjp41 Oct 18, 2021
6db9a2f
Add validate to freelist::Builder
mjp41 Oct 18, 2021
1de28ee
test/func/malloc fixes
nwf-msr Oct 18, 2021
dba795a
NFC: move some capptr utility functions to that namespace
nwf-msr Oct 17, 2021
c2ce9c1
NFC: Racing stripes on Metaslab accessors
nwf-msr Oct 17, 2021
3462c53
NFC: Remove spurious forward declarations
nwf-msr Aug 20, 2021
c54d2b5
NFC: CapPtr in external_pointer; drop capptr_rebound
nwf-msr Oct 19, 2021
52a4b0c
NFC: Make unsafe_capptr private, use unsafe_ptr()
nwf-msr Oct 20, 2021
554db39
localalloc::dealloc tweak size math for large objects
nwf-msr Oct 17, 2021
7f6378f
test/func/domestication: tweak for robustness
nwf-msr Oct 18, 2021
31b8d99
test/func/memcpy: adjust test sizes
nwf-msr Oct 18, 2021
5bb556c
Convert alloc paths to capptr::Alloc<void>
nwf-msr Oct 20, 2021
f0b7dc4
NFC: Extract MetaCommon from ChunkRecord
nwf-msr Oct 17, 2021
6c115ee
NFC: doc tweaks
nwf-msr Oct 17, 2021
599ae0e
Metaslab: add MetaCommon field
nwf-msr Oct 17, 2021
3cdb7be
MetaEntry: split get_metaslab by intent
nwf-msr Oct 17, 2021
8023a6c
backend/address_space: drop spurious !StrictProvenance guard
nwf-msr Oct 18, 2021
fa45608
freelist: check_prev expects an address_t
nwf-msr Oct 18, 2021
fe43f0b
Placate some compiler errors on CHERI
nwf-msr Oct 18, 2021
97a8bd1
Initial RISC-V AAL
nwf-msr Jul 19, 2021
eb0698f
CI: Add RISC-V 64 cross-build & qemu-user tests
nwf-msr Oct 19, 2021
6f79dde
FreeBSD RISC platforms have fewer address bits
nwf-msr Aug 12, 2021
6ddd11f
CheriBSD/CHERI support
nwf-msr Jul 19, 2021
342d826
CheriBSD bugs workarounds
nwf-msr Oct 18, 2021
4a7cd26
Rename slab_allocator to chunk_allocator
mjp41 Oct 20, 2021
eb6c1a0
Make chunk size at least the page size.
mjp41 Oct 21, 2021
5215bff
Change malloc test suite for errno
mjp41 Oct 21, 2021
4987a19
Rename
mjp41 Oct 22, 2021
cec015f
Add FIFO behaviour for unchecked code.
mjp41 Oct 22, 2021
c1062e6
Add Madvise free to Linux layer
mjp41 Oct 20, 2021
20a114c
Add a timer to the PAL
mjp41 Oct 20, 2021
72ccb23
Add local caching to chunk allocator
mjp41 Oct 20, 2021
3407347
Add custom datastructure for local chunk cache
mjp41 Oct 28, 2021
fd40863
Move some structures to cache lines
mjp41 Oct 28, 2021
19de27f
Improve fast path of handle remote deallocs
mjp41 Oct 28, 2021
dd5c91e
Change Remote Cache default size
mjp41 Oct 28, 2021
7ef1dfd
Fix ARM AAL on Morello
nwf-msr Nov 3, 2021
d01e2cd
Fix tests.
mjp41 Nov 3, 2021
cf89339
Move rsize calculation to a slow path.
mjp41 Nov 3, 2021
02f36a4
Make test fail with more information.
mjp41 Nov 3, 2021
3d403ae
Refactor use of sizeclasses (#415)
mjp41 Nov 10, 2021
91919f6
Update src/backend/pagemap.h
mjp41 Nov 17, 2021
dc542cd
Various fixes for OE (#418)
mjp41 Nov 17, 2021
cd0311b
Nits for rust release (#419)
SchrodingerZhu Nov 17, 2021
faa8003
put likely/unlikely in scope (#420)
SchrodingerZhu Nov 17, 2021
f731bc1
build fix for some 3rd party oses.
devnexen Nov 18, 2021
8e5514b
clean up unused usages (#421)
SchrodingerZhu Nov 19, 2021
e241301
solaris systems build fix (#425)
devnexen Nov 22, 2021
9332557
memory unit test android build fix. (#427)
devnexen Nov 24, 2021
d725bec
Minor improvement to codegen for remaining_bytes
mjp41 Nov 24, 2021
a8ef963
Small comment
mjp41 Nov 24, 2021
c299826
Improve codegen for checks.
mjp41 Nov 24, 2021
5fd3288
Modify heuristic for adding new slabs. (#429)
mjp41 Nov 25, 2021
b1da339
build fix proposal for GCC 11.x (spotted with 11.2.0).
devnexen Dec 1, 2021
9b548ed
Add ownership checkings for FlagLock under debug (#432)
SchrodingerZhu Dec 2, 2021
894b031
Add timeout to ci tests.
mjp41 Dec 1, 2021
9329db1
Remove Win2016 as Github Action support ending.
mjp41 Dec 2, 2021
71d5bb8
add SYS_getrandom fallback for posix PAL (#431)
SchrodingerZhu Dec 2, 2021
7f3642e
Change external thread_alloc example. (#424)
mjp41 Dec 2, 2021
360efa2
export netbsd's reallocarr proposal. (#433)
devnexen Dec 2, 2021
d0df2d0
Fix CI branch name. (#442)
mjp41 Dec 13, 2021
37d2ac4
use ::write and ::fsync in error path (#443)
SchrodingerZhu Dec 15, 2021
f398545
Fix memalign usage
mjp41 Dec 14, 2021
7768765
Fixed locking around notification
mjp41 Dec 14, 2021
0fd5c37
Change MPSCQ to use acquire
mjp41 Dec 15, 2021
4f2d3eb
Enable sanitizers in CI.
mjp41 Dec 15, 2021
9b60e82
CHERI: update StrictProvenance.md for new world order
nwf-msr Nov 11, 2021
13a4b04
CHERI: address_space_core should bound more
nwf-msr Nov 11, 2021
3a509d4
CHERI: Avoid traps on nullptr
nwf-msr Nov 11, 2021
22a05b4
CHERI: dealloc() use cap base, not address
nwf-msr Nov 11, 2021
b777243
Additional CHERI client checks
nwf-msr Nov 18, 2021
be85d53
Factor out sanitizer run.
mjp41 Dec 17, 2021
91d500b
Fix flag lock race condition in Debug.
mjp41 Dec 17, 2021
84ac360
Make MPSCQ invariant thread-safe
mjp41 Dec 17, 2021
1687538
Make explicitly racy part of stack
mjp41 Dec 17, 2021
927575d
Increase barrier strength on ABA.
mjp41 Dec 17, 2021
3fb7c98
That's snmalloc_check_client to you.
nwf-msr Dec 16, 2021
61314f2
Post large deallocations to original thread (#441)
mjp41 Dec 17, 2021
a77890c
PAL netbsd (temporary until some time 2022) build fix. (#450)
devnexen Jan 7, 2022
74a2da1
try enabling windows-2022 (#445)
SchrodingerZhu Jan 7, 2022
4ea978b
Remove fake_large_remote
davidchisnall Jan 7, 2022
419347b
Optimise guarded memcpy (#449)
mjp41 Jan 7, 2022
ef64f6c
Improve check_bounds init check.
mjp41 Jan 10, 2022
f1be609
Small fixes for snmalloc used in FreeBSD libc. (#454)
davidchisnall Jan 21, 2022
3d1b973
Add DEBUG constexpr
mjp41 Feb 1, 2022
63d3928
Add a red-black tree implementation and testing.
mjp41 Jan 24, 2022
5399373
Extend malloc test to check CHERI capability length.
ronorton Feb 7, 2022
20ddf8a
Fix bug setting CHERI bounds in address_space_core.h.
ronorton Feb 7, 2022
79ea087
Add jemalloc compat functions. (#456)
davidchisnall Feb 9, 2022
79486b6
Rearrange templates for buddy allocator.
mjp41 Feb 3, 2022
69c824d
Expose mutable reference to pagemap
mjp41 Feb 3, 2022
be98a27
Improve RBTree
mjp41 Feb 4, 2022
eb00f31
Remove local state from Pagemap representation.
mjp41 Feb 10, 2022
baf35cc
Return a small allocation from realloc(ptr, 0). (#460)
davidchisnall Feb 11, 2022
af8ab2d
Clear freelist pointers on allocation for CHERI or CHECK_CLIENT builds.
ronorton Feb 9, 2022
86aa286
Errno fix (#463)
rmn30 Feb 24, 2022
93efbb4
Refactor error reporting for bounds checks. (#464)
davidchisnall Feb 25, 2022
95bd974
Add test helper macros. (#465)
davidchisnall Feb 25, 2022
c27dd10
shared lib linkage build fix for OpenBSD.
devnexen Feb 15, 2022
c73846e
Improve the `memcpy` implementation. (#466)
davidchisnall Mar 2, 2022
8fc42d1
Add Pal::message. (#467)
davidchisnall Mar 3, 2022
322e74f
[FreeBSD] Exclude unused memory from core dumps. (#469)
davidchisnall Mar 3, 2022
1a75316
`madvise` arguments are not flags. (#470)
davidchisnall Mar 3, 2022
cf9b629
Follow-up on #469 for Linux this time, overriding read only pages cod…
devnexen Mar 4, 2022
18ccfde
Refactor memcpy to allow different versions. (#472)
davidchisnall Mar 4, 2022
dec7d9c
NFC memcpy: move small_copies test to Arch::copy
nwf-msr Mar 4, 2022
611d4dc
PowerPC64 memcpy arch tuning
nwf-msr Mar 4, 2022
a602643
g++ 12 unit test build fix. (#476)
devnexen Mar 7, 2022
5287000
Buddy (#468)
mjp41 Mar 11, 2022
62cce1a
backend/largebuddyrange: remove unnecessary casts
nwf-msr Mar 17, 2022
4ad99d7
Downgrade some casts
nwf-msr Mar 17, 2022
26324e8
Add and plumb unsafe_{to,from}_uintptr<T> casts
nwf-msr Mar 17, 2022
a022a75
Fix Debug symbols for Windows CI. (#483)
mjp41 Mar 20, 2022
a3c8abc
Switch atomic_flag to atomic_bool
mjp41 Mar 18, 2022
6ad7f65
Remove unused code.
mjp41 Mar 18, 2022
9d97a38
Move MetaEntry and MetaCommon to backend
nwf-msr Mar 13, 2022
b5a6613
Move BACKEND_MARKER to backend/metatypes
nwf-msr Mar 16, 2022
772e46f
Additional commentary and more verbose names
nwf-msr Mar 16, 2022
7940fee
Refactor MetaEntry remote_and_sizeclass
nwf-msr Mar 16, 2022
a0377f6
Add docs/AddressSpace.md
nwf-msr Aug 2, 2021
1e1104a
Fix 32bit external pointer.
mjp41 Mar 17, 2022
2ff2cdf
Add test for external pointer on stack
mjp41 Mar 17, 2022
453a7d5
backend: clobber MetaEntry-s in dealloc_chunk
nwf-msr Mar 16, 2022
73be8a3
Fix StatsRange on OE
mjp41 Mar 23, 2022
8216201
Remove ChunkAllocator
mjp41 Mar 23, 2022
bb82ac1
Add a thread id to messages
mjp41 Mar 23, 2022
bdb3183
Remove std::cout
mjp41 Mar 23, 2022
e77b9e2
Add ConcurrencySafe property
mjp41 Mar 23, 2022
6424eda
Stop playing OO games with MetaEntry
nwf-msr Mar 24, 2022
deac29c
CheriBSD renamed VMEM SW perm bit
nwf-msr Mar 13, 2022
dec65d1
Make MetaCommon state public.
davidchisnall Mar 25, 2022
6386cd7
Expose ranges in snmalloc_core. (#496)
davidchisnall Mar 28, 2022
ee70f95
Allow POSIX PALs to overwrite writev and fsync. (#495)
davidchisnall Mar 28, 2022
ede7dbb
Following up using writev/fsync direct syscalls to avoid pthread inte…
devnexen Mar 29, 2022
65ee6b2
Refactor MetaSlab / MetaCommon. (#501)
davidchisnall Apr 1, 2022
f6e9796
Introduce header layering (#503)
davidchisnall Apr 6, 2022
d4226a1
Remove indirection of state in ranges. (#505)
davidchisnall Apr 11, 2022
f0361f8
Pagemap move (#504)
rmn30 Apr 11, 2022
43f5f33
Fix missing consolidation marker
mjp41 Apr 11, 2022
943bae1
Minimal example of #506
mjp41 Apr 11, 2022
848a7b1
Check things in release builds with check-client.
davidchisnall Apr 14, 2022
bf54eeb
New option to name reserved pages.
devnexen Apr 3, 2022
f277cf2
Refactor capptr_domesticate SFINAE to make more statically safe.
ronorton Apr 27, 2022
70eba1e
Refill heuristic (#511)
mjp41 Apr 28, 2022
3e08caa
Simplify asserts introduced in #512. (#513)
rmn30 Apr 29, 2022
56ccb5c
Enable memcpy checks for check shim (#515)
mjp41 May 3, 2022
d927a9a
Modified Metadata range to have separate pool
mjp41 Apr 29, 2022
563d5a5
Make clang on Windows use /Debug
mjp41 May 3, 2022
d47c447
Remove redundant params.
mjp41 May 5, 2022
14b7b40
Add a Stats combiner to make code cleaner.
mjp41 May 5, 2022
9f99642
Ensure logging doesn't affect errno
mjp41 May 8, 2022
325c013
Add some tracing to the backend
mjp41 May 8, 2022
2d44ae9
Check for allocation failure.
mjp41 May 8, 2022
5906b14
Out-of-memory can fail silently
mjp41 May 9, 2022
d5c732f
Preparation for 0.6.0 (#517)
mjp41 May 9, 2022
c4f31bb
Fix markdown (#522)
panekj May 10, 2022
22d7c04
debug_check_empty (#521)
mjp41 May 12, 2022
967f1f2
Allow check_client messages to have parameters
mjp41 May 10, 2022
888d182
Check size is correct if specified
mjp41 May 10, 2022
87d71cc
Add a pipe operation to ranges (#527)
mjp41 May 17, 2022
c445de8
Alter FailFast behaviour of memcpy (#526)
mjp41 May 19, 2022
7ff10c3
Enable accessing parent ranges. (#529)
mjp41 May 19, 2022
1b8aa6b
Haiku build fix post refactoring.
devnexen May 25, 2022
03c9da6
Refactor interface between backend and frontend (#530)
mjp41 May 31, 2022
53d9fd2
Alter PAGE_SIZE usage (#534)
mjp41 May 31, 2022
9464556
Add a TID to the PAL (#536)
mjp41 May 31, 2022
392acff
RFC, NFC: refactor ranges to be nested templates (#535)
nwf-msr Jun 6, 2022
e7e558b
exposes macOs malloc_good_size (#538)
devnexen Jun 7, 2022
e17672d
Missing PRIVATE in cmake. (#539)
mjp41 Jun 7, 2022
6a5f3c2
NFC: backend_helper: generalize chunk bounds
nwf-msr May 31, 2022
966f2f1
NFC: capptr: re-introduce Arena bounds
nwf-msr May 30, 2022
d5b155b
NFC: Generalize Default Pagemap Entry
nwf-msr May 31, 2022
41128a3
NFC: additional generalization for CHERI
nwf-msr May 31, 2022
f41bb32
RFC: Hide CapPtr constructor
nwf-msr Jun 6, 2022
aa61b59
NFC: Generalize smallbuddyrange bounds annotations
nwf-msr Jun 6, 2022
83ac7c6
backend ranges: hide object_range behind accessor
nwf-msr May 31, 2022
a78a16e
smallbuddy ranges are only for small things
nwf-msr May 31, 2022
86124ba
backend ranges: use Arena bounds throughout
nwf-msr May 31, 2022
94957f0
StrictProvenance support in Backend
nwf-msr May 31, 2022
1f79c76
mem/pool: Alloc-bound pooled things
nwf-msr Jun 6, 2022
3fce61e
docs: Update StrictProvenance
nwf-msr Jun 6, 2022
095e8f1
func-malloc: expand CHERI tests to check no-VMEM
nwf-msr Jun 7, 2022
da19291
RFC: Add tests for some CHERI-specific behaviors
nwf-msr Jun 7, 2022
3e72ef6
NFC: cmake: add SNMALLOC_LINK_ICF, default on
nwf-msr Jun 9, 2022
6b0bda0
Support older linux systems (#545)
mfelsche Jun 17, 2022
c560a9a
Fix wrong ifdef in pal_linux.h (#546)
mfelsche Jun 17, 2022
467c28b
Add buffer append method for {,u}intptr_t
nwf-msr Jun 10, 2022
df1dbc9
Add Morello CI
nwf-msr May 25, 2022
b2c75df
NFC: rename ConceptBound to IsBound
nwf-msr Jul 1, 2022
9e0fefc
NFC: Rename ConceptAAL to IsAAL
nwf-msr Jul 6, 2022
db3ae1c
NFC: Rename ConceptPAL to IsPAL
nwf-msr Jul 1, 2022
09bc0c6
NFC: external_pointer address_cast earlier
nwf-msr Jul 6, 2022
009a331
update loongarch
SchrodingerZhu Aug 22, 2022
263543b
format
SchrodingerZhu Aug 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 115 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: snmalloc CI
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master, snmalloc2 ]
branches: [ main, snmalloc1 ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -18,39 +18,65 @@ jobs:
# Build each combination of OS and release/debug variants
os: [ "ubuntu-latest", "ubuntu-18.04", "macos-11", "macos-10.15", "freebsd-12.2", "freebsd-13.0" ]
build-type: [ Release, Debug ]
extra-cmake-flags: [ " " ]
# Extra cmake flags. GitHub Actions matrix overloads `include` to mean
# 'add extra things to a job' and 'add jobs'. You can add extra things
# to a job by specifying things that exist in a job created from the
# matrix definition and adding things. You can specify extra jobs by
# specifying properties that don't match existing jobs. We use
# `cmake-flags` to add cmake flags to all jobs matching a pattern and
# `extra-cmake-flags` to specify a new job with custom CMake flags.
extra-cmake-flags: [ "" ]
# Modify the complete matrix
include:
# Provide the dependency installation for each platform
- os: "ubuntu-18.04"
dependencies: "sudo apt install ninja-build"
cmake-flags: "-DSNMALLOC_USE_CXX17=ON"
- os: "ubuntu-latest"
dependencies: "sudo apt install ninja-build"
- os: "macos-11"
dependencies: "brew update && brew install ninja"
# The homebrew packages are broken at the moment and error out
# after trying to install Python as a dependency of ninja because
# 2to3 exists. As a quick hack, delete it first. This should be
# removed once the homebrew install is fixed.
dependencies: "rm -f /usr/local/bin/2to3 ; brew update && brew install ninja"
- os: "macos-10.15"
dependencies: "brew update && brew install ninja"
dependencies: "rm -f /usr/local/bin/2to3 ; brew update && brew install ninja"
# Skip the tests for the FreeBSD release builds
# Also build-test the checked memcpy implementation while doing these.
# It is run-tested on Linux and should be the same everywhere.
- os: "freebsd-13.0"
build-type: Release
build-only: yes
cmake-flags: "-DSNMALLOC_MEMCPY_BOUNDS=ON -DSNMALLOC_CHECK_LOADS=ON"
- os: "freebsd-12.2"
build-type: Debug
build-only: yes
# Add the self-host build
- os: ubuntu-latest
cmake-flags: "-DSNMALLOC_MEMCPY_BOUNDS=ON -DSNMALLOC_CHECK_LOADS=ON"
# Add the self-host build, using the bounds-checked memcpy in
# maximally paranoid mode (checking loads and stores)
- os: "ubuntu-latest"
build-type: Debug
self-host: true
extra-cmake-flags: "-DSNMALLOC_MEMCPY_BOUNDS=ON -DSNMALLOC_CHECK_LOADS=ON"
dependencies: "sudo apt install ninja-build"
# Extra build to check using pthread library for destructing local state.
- os: "ubuntu-latest"
variant: "Ubuntu (with pthread destructors)."
dependencies: "sudo apt install ninja-build"
build-type: Debug
self-host: true
extra-cmake-flags: "-DSNMALLOC_USE_PTHREAD_DESTRUCTORS=On -DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_C_COMPILER=clang-10"
# Add an extra element to the matrix that does a build with clang 12
# but doesn't run tests.
- os: "freebsd-13.0"
variant: Clang 12 (Build only)
extra-cmake-flags: "-DCMAKE_CXX_COMPILER=clang++12"
build-only: yes
- os: ubuntu-latest
- os: "ubuntu-latest"
variant: Clang 10 libstdc++ (Build only)
dependencies: "sudo apt install ninja-build"
extra-cmake-flags: "-DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_CXX_FLAGS=-stdlib=libstdc++"
extra-cmake-flags: "-DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_C_COMPILER=clang-10 -DCMAKE_CXX_FLAGS=-stdlib=libstdc++"
build-only: yes
# Don't abort runners if a single one fails
fail-fast: false
Expand All @@ -61,30 +87,58 @@ jobs:
- name: Install build dependencies
run: ${{ matrix.dependencies }}
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -G Ninja ${{ matrix.extra-cmake-flags }}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -G Ninja ${{ matrix.cmake-flags }} ${{ matrix.extra-cmake-flags }}
# Build with a nice ninja status line
- name: Build
working-directory: ${{github.workspace}}/build
run: NINJA_STATUS="%p [%f:%s/%t] %o/s, %es" ninja
- name: Test file size of binaries is sane
working-directory: ${{github.workspace}}/build
run: "ls -l func-first_operation-1 ; [ $(ls -l func-first_operation-1 | awk '{ print $5}') -lt 10000000 ]"
run: "ls -l func-first_operation-fast ; [ $(ls -l func-first_operation-fast | awk '{ print $5}') -lt 10000000 ]"
# If the tests are enabled for this job, run them
- name: Test
if: ${{ matrix.build-only != 'yes' }}
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure -j 4
run: ctest --output-on-failure -j 4 -C ${{ matrix.build-type }} --timeout 400
- name: Selfhost
if: ${{ matrix.self-host }}
working-directory: ${{github.workspace}}/build
run: |
sudo cp libsnmallocshim.so libsnmallocshim-16mib.so libsnmallocshim-oe.so /usr/local/lib/
sudo cp libsnmallocshim.so libsnmallocshim-checks.so /usr/local/lib/
ninja clean
LD_PRELOAD=/usr/local/lib/libsnmallocshim.so ninja
ninja clean
LD_PRELOAD=/usr/local/lib/libsnmallocshim-16mib.so ninja
ninja clean
LD_PRELOAD=/usr/local/lib/libsnmallocshim-oe.so ninja
LD_PRELOAD=/usr/local/lib/libsnmallocshim-checks.so ninja

sanitizer:
strategy:
matrix:
# Build each combination of OS and release/debug variants
os: [ "ubuntu-latest"]
build-type: [ Release, Debug ]
include:
- os: "ubuntu-latest"
continue-on-error: # Don't class as an error if this fails, until we have a more reliablity.
variant: Clang 10 libc++ (TSan + UBSan)
dependencies: "sudo apt install ninja-build"
extra-cmake-flags: "-DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_CXX_FLAGS=-stdlib=\"libc++ -g\" -DSNMALLOC_SANITIZER=undefined,thread"
# Don't abort runners if a single one fails
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.build-type }} ${{ matrix.variant }}
steps:
- uses: actions/checkout@v2
- name: Install build dependencies
run: ${{ matrix.dependencies }}
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -G Ninja ${{ matrix.cmake-flags }} ${{ matrix.extra-cmake-flags }}
# Build with a nice ninja status line
- name: Build
working-directory: ${{github.workspace}}/build
run: NINJA_STATUS="%p [%f:%s/%t] %o/s, %es" ninja
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure -j 4 -C ${{ matrix.build-type }} --timeout 400 -E "memcpy|external_pointer" --repeat-until-fail 2

qemu-crossbuild:
strategy:
Expand All @@ -95,18 +149,28 @@ jobs:
system-processor: arm
triple: arm-linux-gnueabihf
rtld: ld-linux-armhf.so.3
ld-flavour: lld
- name: arm64
system-processor: aarch64
triple: aarch64-linux-gnu
rtld: ld-linux-aarch64.so.1
ld-flavour: lld
- name: ppc64el
system-processor: powerpc64le
triple: powerpc64le-linux-gnu
rtld: ld64.so.2
ld-flavour: lld
- name: riscv64
system-processor: riscv64
triple: riscv64-linux-gnu
rtld: ld-linux-riscv64-lp64d.so.1
extra-packages: binutils-riscv64-linux-gnu
ld-flavour: bfd
ld: /usr/bin/riscv64-linux-gnu-ld.bfd
# Don't abort runners if a single one fails
fail-fast: false
runs-on: ubuntu-latest
name: Cross-build for ${{ matrix.arch.triple }}
name: ${{matrix.build-type}} cross-build for ${{ matrix.arch.triple }}
steps:
- uses: actions/checkout@v2
- name: Install cross-compile toolchain and QEMU
Expand All @@ -117,6 +181,14 @@ jobs:
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main"
sudo apt update
sudo apt install libstdc++-9-dev-${{ matrix.arch.name }}-cross qemu-user ninja-build clang-13 lld-13
sudo apt install ${{matrix.arch.extra-packages}}
# The default PowerPC qemu configuration uses the wrong page size.
# Wrap it in a script that fixes this.
sudo update-binfmts --disable qemu-ppc64le
sudo sh -c 'echo ":qemu-ppc64le:M:0:\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00:`pwd`/ppc64.sh:" > /proc/sys/fs/binfmt_misc/register'
echo '#!/bin/sh' > ppc64.sh
echo '/usr/bin/qemu-ppc64le -p 65536 $@' >> ppc64.sh
chmod +x ppc64.sh
- name: Configure
run: >
RTLD_NAME=${{ matrix.arch.rtld }}
Expand All @@ -130,6 +202,8 @@ jobs:
-DSNMALLOC_QEMU_WORKAROUND=ON
-DSNMALLOC_STATIC_LIBRARY=OFF
-DCMAKE_TOOLCHAIN_FILE=ci/Toolchain.cmake
-DSNMALLOC_LINKER=${{matrix.arch.ld}}
-DSNMALLOC_LINKER_FLAVOUR=${{matrix.arch.ld-flavour}}
- name: Build
working-directory: ${{github.workspace}}/build
run: NINJA_STATUS="%p [%f:%s/%t] %o/s, %es" ninja
Expand All @@ -138,31 +212,43 @@ jobs:
# QEMU)
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure -E '(perf-.*)|(.*-malloc$)'
run: ctest --output-on-failure -E '(perf-.*)|(.*-malloc$)' --timeout 400
timeout-minutes: 30

windows:
strategy:
matrix:
# Build each combination of OS and release/debug variants
os: [ windows-2016, windows-2019 ]
os: [ windows-2019 ]
build-type: [ Release, Debug ]
arch: [ Win32, x64 ]
toolchain: [ "", "-T ClangCL" ]
extra-cmake-flags: [ "" ]
# The ClangCL toolchain was added in Visual Studio 2019, the Windows
# 2016 runners have only VS 2017, so skip them for this configuration
exclude:
- os: windows-2016
toolchain: "-T ClangCL"
# Add an extra check for the Windows 8 compatible PAL
include:
- os: windows-2016
- os: windows-2019
build-type: Release
arch: x64
toolchain: ""
extra-cmake-flags: -DWIN8COMPAT=TRUE
variant: Windows 8 compatible
- os: windows-2022
build-type: Release
arch: Win32
toolchain: ""
- os: windows-2022
build-type: Debug
arch: Win32
toolchain: ""
- os: windows-2022
build-type: Release
arch: x64
toolchain: ""
- os: windows-2022
build-type: Debug
arch: x64
toolchain: ""

# Don't abort runners if a single one fails
fail-fast: false
runs-on: ${{ matrix.os }}
Expand All @@ -178,7 +264,8 @@ jobs:
# Run the tests.
- name: Test
working-directory: ${{ github.workspace }}/build
run: ctest -j 2 --interactive-debug-mode 0 --output-on-failure -C ${{ matrix.build-type }}
run: ctest -j 2 --interactive-debug-mode 0 --output-on-failure -C ${{ matrix.build-type }} --timeout 400
timeout-minutes: 20


# Job to run clang-format and report errors
Expand All @@ -188,7 +275,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build
run: cmake -B ${{github.workspace}}/build -DSNMALLOC_USE_CXX17=ON
- name: Install clang-tidy
run: sudo apt install clang-tidy-9
# Run the clang-format check and error if it generates a diff
Expand All @@ -200,7 +287,7 @@ jobs:
git diff --exit-code
- name: Run clang-tidy
run: |
clang-tidy-9 src/override/malloc.cc -header-filter="`pwd`/*" -warnings-as-errors='*' -export-fixes=tidy.fail -- -std=c++17 -mcx16 -DSNMALLOC_PLATFORM_HAS_GETENTROPY=0
clang-tidy-9 src/snmalloc/override/malloc.cc -header-filter="`pwd`/*" -warnings-as-errors='*' -export-fixes=tidy.fail -- -std=c++17 -mcx16 -DSNMALLOC_PLATFORM_HAS_GETENTROPY=0
if [ -f tidy.fail ] ; then
cat tidy.fail
exit 1
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/morello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: snmalloc CI for Morello

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
# UNIX-like, but with some needed TLC for the moment, so not folded in to the main unixlike CI.
# Morello can't easily self-host since it mixes purecap and hybrid build tools.
# We point cmake at the LLVM Clang frontend explicitly lest it pick up the more magic wrappers.
morello:
strategy:
matrix:
# Build each combination of OS and release/debug variants
os: [ "morello" ]
build-type: [ Release, Debug ]
caps: [ Hybrid, Purecap ]
include:
- os: "morello"
caps: Hybrid
dependencies: |
pkg64 install -y llvm-localbase cmake ninja
cmake-flags: >
-DCMAKE_CXX_COMPILER=/usr/local64/bin/clang++
-DCMAKE_C_COMPILER=/usr/local64/bin/clang
-DCMAKE_CXX_FLAGS='-march=morello -Xclang -morello-vararg=new'
-DCMAKE_C_FLAGS='-march=morello -Xclang -morello-vararg=new'
- os: "morello"
caps: Purecap
dependencies: |
pkg64 install -y llvm-localbase cmake ninja
cmake-flags: >
-DCMAKE_CXX_COMPILER=/usr/local64/bin/clang++
-DCMAKE_C_COMPILER=/usr/local64/bin/clang
-DCMAKE_CXX_FLAGS='-march=morello -mabi=purecap -Xclang -morello-vararg=new'
-DCMAKE_C_FLAGS='-march=morello -mabi=purecap -Xclang -morello-vararg=new'
-DSNMALLOC_LINK_ICF=OFF
# SNMALLOC_LINK_ICF=OFF until the fix for
# https://git.morello-project.org/morello/llvm-project/-/issues/51 , namely
# https://git.morello-project.org/morello/llvm-project/-/commit/f41cb9104e0793de87d98b38acb274b2e3266091
# lands in a package or a release. That's probably the Fall 2022 release.
# Don't abort runners if a single one fails
fail-fast: false
# Morello needs special handling to get picked up by our self-hosted runners
# When/if we do integrate this back into the unixlike matrix above, we could
# say something like::
# runs-on: >-
# ${{ (matrix.os == 'morello' && fromJSON('["self-hosted", "msr-morello", "2022.05-benchmark"]'))
# || matrix.os }}
# to dispatch dynamically.
runs-on: ["self-hosted", "msr-morello", "2022.05-benchmark"]
name: ${{ matrix.os }} ${{ matrix.build-type }} ${{ matrix.caps }}
steps:
- uses: actions/checkout@v2
- name: Install build dependencies
run: ${{ matrix.dependencies }}
- name: Configure CMake
run: >
cmake
-B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{matrix.build-type}}
-G Ninja ${{ matrix.cmake-flags }}
${{ matrix.extra-cmake-flags }}
# Build with a nice ninja status line
- name: Build
# https://github.com/ChristopherHX/github-act-runner seemingly ignores working-directory,
# but everyone agrees that we start in ${{github.workspace}} by default, so just cd into
# the build directory ourselves. See
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
# https://github.com/ChristopherHX/github-act-runner/issues/61
# working-directory: ${{github.workspace}}/build
run: |
cd build
NINJA_STATUS="%p [%f:%s/%t] %o/s, %es" ninja
- name: Test file size of binaries is sane
# working-directory: ${{github.workspace}}/build
run: |
cd build
ls -l func-first_operation-fast ; [ $(ls -l func-first_operation-fast | awk '{ print $5}') -lt 10000000 ]
# If the tests are enabled for this job, run them
- name: Test
if: ${{ matrix.build-only != 'yes' }}
# working-directory: ${{github.workspace}}/build
run: |
cd build
ctest --output-on-failure -j 4 -C ${{ matrix.build-type }} --timeout 400
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# conventional build dirs
release*/
debug*/
build*/
cmake-build-*/

# cmake intermediate files
CMakeFiles/

# vscode dirs
.vscode/
.vs/

# jetbrains IDE dirs
.idea/

# special endings
*~
*.sw?

Loading