Skip to content

Commit

Permalink
Trying to fix Windows CI (#539)
Browse files Browse the repository at this point in the history
* Trying to fix Windows CI

* Triage

* More triage

* Even more triage

* Trying to break things again

* Still trying to break

* closer

* This should do it

* One more time

* More CI fixes
  • Loading branch information
jatinchowdhury18 authored Jun 18, 2024
1 parent 5a7b118 commit ec8a440
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
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

0 comments on commit ec8a440

Please sign in to comment.