diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 072755e95..237e5a749 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -373,7 +373,10 @@ jobs: # Run the clang-format check and error if it generates a diff - name: Run clang-format working-directory: ${{github.workspace}}/build - run: make clangformat-check + run: | + set -eo pipefail + make clangformat + git diff --exit-code - name: Run clang-tidy run: | clang-tidy-15 src/snmalloc/override/malloc.cc -header-filter="`pwd`/*" -warnings-as-errors='*' -export-fixes=tidy.fail -- -std=c++17 -mcx16 -DSNMALLOC_USE_WAIT_ON_ADDRESS=1 -DSNMALLOC_PLATFORM_HAS_GETENTROPY=0 -Isrc diff --git a/src/snmalloc/global/libc.h b/src/snmalloc/global/libc.h index 99df44617..726f61190 100644 --- a/src/snmalloc/global/libc.h +++ b/src/snmalloc/global/libc.h @@ -39,6 +39,12 @@ namespace snmalloc::libc dealloc(ptr, size); } + SNMALLOC_FAST_PATH_INLINE void + free_aligned_sized(void* ptr, size_t alignment, size_t size) + { + dealloc(ptr, size, alignment); + } + SNMALLOC_FAST_PATH_INLINE void* calloc(size_t nmemb, size_t size) { bool overflow = false; diff --git a/src/snmalloc/override/malloc.cc b/src/snmalloc/override/malloc.cc index 267546785..cf949680d 100644 --- a/src/snmalloc/override/malloc.cc +++ b/src/snmalloc/override/malloc.cc @@ -23,6 +23,17 @@ extern "C" snmalloc::libc::free(ptr); } + SNMALLOC_EXPORT void SNMALLOC_NAME_MANGLE(free_sized)(void* ptr, size_t size) + { + snmalloc::libc::free_sized(ptr, size); + } + + SNMALLOC_EXPORT void SNMALLOC_NAME_MANGLE(free_aligned_sized)( + void* ptr, size_t alignment, size_t size) + { + snmalloc::libc::free_aligned_sized(ptr, alignment, size); + } + SNMALLOC_EXPORT void SNMALLOC_NAME_MANGLE(cfree)(void* ptr) { snmalloc::libc::free(ptr);