Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/snmalloc/global/libc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 11 additions & 0 deletions src/snmalloc/override/malloc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading