Skip to content

Commit

Permalink
support array types
Browse files Browse the repository at this point in the history
  • Loading branch information
KRM7 committed Feb 18, 2024
1 parent 976a840 commit b074eed
Show file tree
Hide file tree
Showing 5 changed files with 251 additions and 93 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ jobs:
fail-fast: false
matrix:
sanitizer: [ address, undefined ]
include:
- cxx: clang++-15
pkgs: clang-15 llvm-15

compiler: [
{ cxx: clang++-15, pkgs: clang-15 },
{ cxx: g++-12, pkgs: g++-12 }
]

env:
ASAN_OPTIONS: check_initialization_order=1:strict_init_order=1:detect_stack_use_after_return=1:detect_leaks=1:detect_invalid_pointer_pairs=2
UBSAN_OPTIONS: print_stacktrace=1:print_summary=1
Expand All @@ -22,20 +23,20 @@ jobs:
working-directory: ${{ github.workspace }}/build


name: ${{ matrix.cxx }} -fsanitize=${{ matrix.sanitizer }}
name: ${{ matrix.compiler.cxx }} -fsanitize=${{ matrix.sanitizer }}

steps:
- name: checkout-repo
uses: actions/checkout@v3

- name: setup-compiler
run: sudo apt update && sudo apt install -y ${{ matrix.pkgs }}
run: sudo apt update && sudo apt install -y ${{ matrix.compiler.pkgs }}

- name: setup-catch
run: sudo bash ./install_catch.sh -DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
run: sudo bash ./install_catch.sh -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }}

- name: setup-build
run: sudo cmake .. -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_CXX_FLAGS="-fsanitize=${{ matrix.sanitizer }} -g -fno-omit-frame-pointer"
run: sudo cmake .. -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_CXX_FLAGS="-fsanitize=${{ matrix.sanitizer }} -g -fno-omit-frame-pointer"

- name: build
run: sudo cmake --build .
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ generally be:
- 48 for polymorphic types
- 56 for polymorphic types that implement a virtual `small_unique_ptr_move` method
- `sizeof(T)` for non-polymophic types, with an upper limit of 56
- 56 for array types

The overall size of a `small_unique_ptr<T>` object is:

Expand All @@ -30,7 +31,7 @@ The interface matches `std::unique_ptr<T>`, except for:
- There is no `Deleter` template parameter or any of the associated methods
- Constructors from pointers are not provided except for the nullptr constructor
- `release()` is not implemented
- `T` can't be an incomplete type or an array type
- `T` can't be an incomplete type
- There are a couple of extra methods for checking where objects are allocated

Everything is constexpr, but the stack buffer is not used in constant evaluated contexts,
Expand Down
35 changes: 0 additions & 35 deletions core-guidelines.ruleset

This file was deleted.

Loading

0 comments on commit b074eed

Please sign in to comment.