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

Trying to fix Windows CI #539

Merged
merged 10 commits into from
Jun 18, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
build_type: "Release"
- name: "Test"
os: windows-2022
build_type: "Release"
build_type: "Debug"
- name: "Coverage"
os: ubuntu-22.04
cmake_args: "-DCODE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct STLArenaAllocator

T* allocate (std::size_t n)
{
return static_cast<T*> (arena.allocate_bytes (n, alignof (T)));
return static_cast<T*> (arena.allocate_bytes (n * sizeof (T), alignof (T)));
}

void deallocate (T*, std::size_t) const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ template <typename ElementType, typename DerivedType>
AbstractTree<ElementType, DerivedType>::~AbstractTree()
{
doForAllNodes ([] (Node& node)
{ node.~Node(); });
{ node.leaf.reset(); });
}

template <typename ElementType, typename DerivedType>
Expand Down Expand Up @@ -108,7 +108,7 @@ void AbstractTree<ElementType, DerivedType>::removeNode (Node& node)
node.parent->last_child = node.prev_sibling;
}

node.~Node();
node.leaf.reset();
}

template <typename ElementType, typename DerivedType>
Expand Down Expand Up @@ -150,9 +150,10 @@ template <typename ElementType, typename DerivedType>
void AbstractTree<ElementType, DerivedType>::clear()
{
doForAllNodes ([] (Node& node)
{ node.~Node(); });
{ node.leaf.reset(); });
allocator.reset (64 * sizeof (Node));
count = 0;
root_node = {};
}

template <typename ElementType, typename DerivedType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ struct EnumMap
{
++index;
++iter;
} while (! iter->has_value() && index < std::tuple_size_v<Storage>);
} while (index < std::tuple_size_v<Storage> && ! iter->has_value());

if (index < std::tuple_size_v<Storage>)
key = magic_enum::enum_value<Key> (index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ TEST_CASE ("Enum Map Test", "[common][data-structures]")
};

size_t iter = 0;
for (auto [key, val] : std::as_const (map))
for (const auto& [key, val] : std::as_const (map))
{
jassert (iter < 2);
if (iter == 0)
Expand All @@ -92,7 +92,7 @@ TEST_CASE ("Enum Map Test", "[common][data-structures]")

iter = 0;
for (auto [key, val] : map)
val = (int) iter++;
val = static_cast<int> (iter++);
REQUIRE (map[Food::Apple] == 0);
REQUIRE (map[Food::Green_Beans] == 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
TEST_CASE ("STL Arena Allocator Test", "[common][data-structures]")
{
using Arena = chowdsp::ArenaAllocator<>;
Arena arena { 128 };
Arena arena { 512 };

using Alloc = chowdsp::STLArenaAllocator<int, Arena>;
Alloc alloc { arena };
Expand Down
Loading