Releases: microsoft/snmalloc
0.7.3
What's Changed
This release primarily improves for CMake for downstream uses of snmalloc.
Build
- CMAKE: Libs should not require headers by @mjp41 in #797
- Remove interface linking for PRIVATE linkage by @maxtropets in #799
CI
- Benchmarking automatically by @mjp41 in #795
- Removing benchmarking from PR triggers by @mjp41 in #800
New Contributors
- @maxtropets made their first contribution in #799
Full Changelog: 0.7.2...0.7.3
0.7.2
What's Changed
Secondary Allocator
Thanks to @SchrodingerZhu for allowing snmalloc to support a secondary allocator, such as GWP-Asan.
This feature allows snmalloc to pass some allocation and their corresponding deallocation to another allocator.
This can be used for a GWP-Asan integration, and will be used to enable detours on Windows to override the default allocator.
- Enable a secondary allocator support (e.g. GWP-Asan) by @SchrodingerZhu in #737
- Fix test when using GWP-Asan by @mjp41 in #758
- Make Secondary Allocator a template parameter by @mjp41 in #774
The next major release will build more on this feature.
Platforms
Windows support
Thanks to @NeilMonday for the Windows support improvements in particular the ability to unload snmalloc without leaking the memory associated with snmalloc.
- Windows: Remove exception handler for pagemap on unloading by @NeilMonday in #746
- Release all reservations at the very end of the program or DLL by @NeilMonday in #773
Rust
Libc support
- Protection against fork by @mjp41 in #735
- Update realloc(p,0) semantics. by @mjp41 in #753
- Prevent internal errno setting escaping to the client. by @mjp41 in #754
C++ support
CI and build
- Mistaken commit of message_once by @mjp41 in #741
- cmake: Fix HAS_EXCEPTION on Windows. by @mjp41 in #743
- CI: Refresh Targets by @mjp41 in #748
- build: Fix nothrow include. by @mjp41 in #749
- CI: Cancel inflight checks on a new push. by @mjp41 in #760
- Header-only build fix for WIN32_LEAN_AND_MEAN redefinition by @sooknarine in #764
- Remove 20.04 from CI by @mjp41 in #768
- Drop Win2019 from CI by @mjp41 in #778
- Update minimum CMake version #793
Bazel
Thanks to @jayakasadev for adding Bazel support to snmallocs build.
- feat: add support for bazel by @jayakasadev in #759
- Add build platform and type to Bazel cache key by @mjp41 in #779
Refactor and minor bugs fixes
- Refactor: Remove unused features and functions, and move most allocator operations to a global namespace. by @mjp41 in #750
- Bug fixes by @mjp41 in #752
- Fixed pagemap reservations for a fixed-region use-case using the default PAL by @Trithek in #757
- Refactor check_bounds by @mjp41 in #756
- Refactor representation of thread local state. by @mjp41 in #751
- Fix bug in pool sort by @mjp41 in #765
- Reentrancy init by @mjp41 in #767
- Fix CI by @mjp41 in #776
- Remove tests for experimental jemalloc ABIs by @markjdb in #770
- Adjust func-memory test to be shorter. by @mjp41 in #780
- Improve sizeclass calculation by @mjp41 in #777
- Pass continuations for success and failure cases by @mjp41 in #788
- Fallible notify using by @mjp41 in #790
- Code Quality - inlining and reduce PreventFork usage by @mjp41 in #792
New Contributors
- @Trithek made their first contribution in #757
- @sooknarine made their first contribution in #764
- @wpbrown made their first contribution in #763
- @jayakasadev made their first contribution in #759
- @markjdb made their first contribution in #770
Full Changelog: 0.7.1...0.7.2
0.7.1
What's Changed
If you are using 0.7.0, it is highly recommended you update to 0.7.1 to fix a bug in the wake on address implementation.
Bug Fixes
Optimisations
Platform support
- Improve Windows memcpy protection using an exception handler in the PAL to lazily commit the pagemap by @mjp41 in #727 & #730
- OpenBSD add support for WaitOnAddress by @devnexen in #716
- Solaris add support for OS level Aligned Allocation by @devnexen in #723
- MinGW fixed missing <errno.h> for ENOMEM by @jcelerier in #733
- MSVC fix signature of _msize function by @NeilMonday in #708
- OpenBSD: memcpy test fix build warning. by @devnexen in #714
Docs
- Updating the build doc by @NeilMonday in #705
- Remove Morello CI Badge by @mjp41 in #710
Build
- cmake: detect rdynamic flag by @jcelerier in #699
- cmake: restrict usage of
_HAS_EXCEPTIONS=0by @mjp41 in #707 - Change
DEBUGconstexpr toDebugby @NeilMonday in #729 - cmake: Fixes for Arch Luinux by @mjp41 in #734
CI
- Updates to handle newer Ubuntu images by @mjp41 in #726
- Update MacOS machines, and add Tracing Target by @mjp41 in #706
Code Refactoring
- Remove PAL dependencies from Singleton and FlagLock by @mjp41 in #725
- Refactor headers to enable building as a component inside a libc implementation @SchrodingerZhu in
- remove TrivialInitAtomic by @SchrodingerZhu in #711
- remove string_view STL dependency by @SchrodingerZhu in #703
- simplify MessageBuilder construction by @SchrodingerZhu in #713
- start self-vendored STL with atomic by @SchrodingerZhu in #715
- provide proxy layers for type traits by @SchrodingerZhu in #717
- remove chrono dependency for windows by @SchrodingerZhu in #718
- use customised placement-new by @SchrodingerZhu in #719
- use c headers instead of c++ headers by @SchrodingerZhu in #720
- self-vendor utility headers by @SchrodingerZhu in #721
- self vendor array and algorithm headers by @SchrodingerZhu in #722
- remove extra puts definitions by @SchrodingerZhu in #731
New Contributors
- @jcelerier made their first contribution in #699
- @NeilMonday made their first contribution in #705
- @wareya made their first contribution in #739
Full Changelog: 0.7.0...0.7.1
0.7.0
What's Changed
See https://github.com/microsoft/snmalloc/blob/main/docs/release/0.7/README.md for an introduction to the 0.7 release.
Optimisation
Startup time
- Startup improvements by @mjp41 in #639
- Startup speed by @mjp41 in #665
- Implement MCS Combining lock by @mjp41 in #666
- Add documentation for the combining lock by @mjp41 in #683
- implement polite waiting by @SchrodingerZhu in #685
Produce Consumer workloads (BatchIt)
- Using exclusive mode prefetch by @mjp41 in #627
- Refactorings to support BatchIt by @nwf-msr in #652
- msgpass benchmark and its refactoring dependencies by @nwf-msr in #659
- Bottom commits from BatchIt by @nwf-msr in #675
- BatchIt by @nwf in #677
Security Features
Platforms and Bindings
Libc
- Factor out libc code into a header. by @mjp41 in #624
- Remove unnecessary assertion from aligned_alloc by @mjp41 in #658
- aligned_alloc: Permit alignment values smaller than sizeof(uintptr_t) by @bsdjhb in #671
- aligned_alloc requirements update. by @devnexen in #681
Rust
Windows
- Override _msize on windows by @Naville in #633
- Disable empty static prefix for Windows. by @mjp41 in #629
- Add Windows ARM64 support by @jblazquez in #656
Haiku
NetBSD
Minor changes and refactorings
- Add a default constructor to seqset nodes. by @davidchisnall in #636
- Template construction of Pool elements by @mjp41 in #641
- NFC: sizeclass: differentiate minimum step size and minimum allocation sizes by @nwf-msr in #651
- Refactor new/delete overrides by @mjp41 in #660
- Remove the SNMALLOC_USE_CXX17 C preprocessor symbol by @nwf-msr in #667
- 0-length arrays in Buddy ranges by @nwf-msr in #672
- gcc UAF warning in test/perf/singlethread -malloc by @nwf in #679
- Remove some unneeded headers by @mjp41 in #680
- Remove unneeded template. by @mjp41 in #687
Build and CI
- Move to clang-format 15 by @mjp41 in #621
- Adding an option to enable dynamic loading by @matajoh in #632
- Add C++17 version for Mac. by @mjp41 in #635
- Workaround runner issue. by @mjp41 in #645
- FreeBSD CI. by @mjp41 in #647
- Update NetBSD runner by @mjp41 in #648
- Updated CI workaround. by @mjp41 in #650
- Rework CI by @nwf-msr in #674
- Further gcc -Werror=array-bounds fix by @nwf in #678
- Provide option to CMake for Page Size by @mjp41 in #664
- fuzzing test and detect the memmove error by @SchrodingerZhu in #688
- Add fuzz to CI by @mjp41 in #690
- clean up Result and make Result move-only by @SchrodingerZhu in #691
- Minor update to clangformat file. by @mjp41 in #694
- avoid chrono inclusion when clock_gettime is available by @SchrodingerZhu in #695
New Contributors
- @matajoh made their first contribution in #632
- @Naville made their first contribution in #633
- @jblazquez made their first contribution in #656
- @bsdjhb made their first contribution in #671
Full Changelog: 0.6.2...0.7.0
0.6.2
Minor release primarily improving support on CHERI and Open Enclave
- CHERI (#587, #557, #578)
- Open Enclave provide new low memory mode that disables some thread caching (#612, #617)
- Improve security checks (emptyness #569, separate features #587))
- Improve ranges support (#540, #556, #562, #619)
- Performance (#604, #605, #606, #607)
- NetBSD support (#583)
- ARM support (#564, #601
- Debug performance improvement (#585)
- Fix C++ overrides argument order that caused a assert failure (#597)
- Improve override for RTLD_DEEPBIND (#598)
- Code tidying (#548, #554, #558, #565, #568)
- C++ support (#574, #581, #591)
- CI improvements/build ( #555, #559, #579, #580, #582, #588, #589, #590, #592, #599, #608, #613, #614, #620)
- Documentation (#602, #610, #611)
Thanks to @devnexen, @saaramar, @brvtalcake, @jumaffre and @EAirPeter for your contributions to this release.
0.6.1
Minor release. Largest change is bringing online Morello CHERI support.
- CHERI support (#537, #542, #532, #543)
- Improve error messages for checks (#526, #521)
- Increased checks on client (#520, #550)
- Portability fixes for Haiku and older versions of glibc (#545, #546, #533)
- Expose macOS
malloc_good_size(#538) - General code tidying (#527, #535, #547, #551, #536, #534, #529)
- Documentation (#551, #522)
Thanks to the external contributors @panekj, @devnexen and @mfelsche.
0.6.0
This is a major revision of the snmalloc design. The redesign has been primarily focused on adding new security features. The redesign affects all aspects of snmalloc. A more comprehensive explanation of the new features can be found in the docs
- Uses Buddy Allocators for large allocations: In 0.5.3, we never reconsolidate large allocations, so if you ask for several 1MiB allocations, return them, and then ask for several 2MiB allocations it won't be able to use the space from the 1MiB allocations. This is not a problem in 0.6 as we have a proper buddy allocator at that level so we recombine the big bits of memory properly
- Variable sized slabs and out of band meta-data - Previously, snmalloc used fixed sized super slabs with metadata at the head. By using variable sized slabs and out of band meta-data, the slabs don't have to be grouped into superslabs which reduces the minimum memory requirement. (https://github.com/microsoft/snmalloc/blob/main/docs/security/VariableSizedChunks.md)
- Improved per thread caching - #511 - This enables very small per thread usage initially that can grow to the level required. This means that low foot print scenarios on OpenEnclave can be supported with exactly the same code paths as high footprint scenarios. This brings the per thread costs down to approximately 16k per thread of metadata + 16k per thread per sizeclass used. This will grow in powers of 2 (upto 2MiB) to cover the required amount.
0.5.3
0.5.2
Bug fixes
- Fixes issue where unused memory is zeroed by the OS, then superslab data can become corrupt. Only affected the 16MiB chunk size configuration. The bug did not affect the Linux implementation. #259
- Typo that meant 16MiB configuration was ignored in some cases. #254
Platform Support
Thanks especially to @devnexen for finding and fixing many issues in this release, and for the contributions to many previous releases in expanding snmallocs platform support.
0.5.1
The main change in this release is a new mechanism for tracking very coarse-grained memory usage statistics (#241). The interface is only exposed in malloc-extensions.h. We recommend static linking this API, as we may refine this in future releases.
Other changes:
- PALs now fully static (#245)
Bug fixes: