aboutsummaryrefslogtreecommitdiff
path: root/zenstore/blockstore.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-04-19 10:43:28 +0200
committerStefan Boberg <[email protected]>2023-04-19 10:52:48 +0200
commit9fb9d6ce5aaedd4ecf4f7bdc9c33a94b1e6597b2 (patch)
tree924c8ede64e087a5bdfeeb87862bc08e325f4ddc /zenstore/blockstore.cpp
parentadded missing #pragma once (diff)
downloadzen-9fb9d6ce5aaedd4ecf4f7bdc9c33a94b1e6597b2.tar.xz
zen-9fb9d6ce5aaedd4ecf4f7bdc9c33a94b1e6597b2.zip
tweaks for enabling unity builds
mostly changes to make sure anonymous namespaces don't clash and a change to avoid windows headers from leaking into other compilation units unity builds are not yet enabled by default, but can be enabled by uncommenting this line in the root `xmake.lua` ``` --add_rules("c++.unity_build") ```
Diffstat (limited to 'zenstore/blockstore.cpp')
-rw-r--r--zenstore/blockstore.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/zenstore/blockstore.cpp b/zenstore/blockstore.cpp
index 5d81d1120..d743c431f 100644
--- a/zenstore/blockstore.cpp
+++ b/zenstore/blockstore.cpp
@@ -859,7 +859,7 @@ TEST_CASE("blockstore.blockfile")
CHECK(!std::filesystem::exists(RootDirectory / "1"));
}
-namespace {
+namespace blockstore::impl {
BlockStoreLocation WriteStringAsChunk(BlockStore& Store, std::string_view String, size_t PayloadAlignment)
{
BlockStoreLocation Location;
@@ -907,10 +907,12 @@ namespace {
return IoBufferBuilder::MakeCloneFromMemory(Values.data(), Values.size());
}
-} // namespace
+} // namespace blockstore::impl
TEST_CASE("blockstore.chunks")
{
+ using namespace blockstore::impl;
+
ScopedTemporaryDirectory TempDir;
auto RootDirectory = TempDir.Path();
@@ -939,6 +941,8 @@ TEST_CASE("blockstore.chunks")
TEST_CASE("blockstore.clean.stray.blocks")
{
+ using namespace blockstore::impl;
+
ScopedTemporaryDirectory TempDir;
auto RootDirectory = TempDir.Path();
@@ -963,6 +967,8 @@ TEST_CASE("blockstore.clean.stray.blocks")
TEST_CASE("blockstore.flush.forces.new.block")
{
+ using namespace blockstore::impl;
+
ScopedTemporaryDirectory TempDir;
auto RootDirectory = TempDir.Path();
@@ -984,6 +990,8 @@ TEST_CASE("blockstore.flush.forces.new.block")
TEST_CASE("blockstore.iterate.chunks")
{
+ using namespace blockstore::impl;
+
ScopedTemporaryDirectory TempDir;
auto RootDirectory = TempDir.Path();
@@ -1078,6 +1086,8 @@ TEST_CASE("blockstore.iterate.chunks")
TEST_CASE("blockstore.reclaim.space")
{
+ using namespace blockstore::impl;
+
ScopedTemporaryDirectory TempDir;
auto RootDirectory = TempDir.Path();
@@ -1193,6 +1203,8 @@ TEST_CASE("blockstore.reclaim.space")
TEST_CASE("blockstore.thread.read.write")
{
+ using namespace blockstore::impl;
+
ScopedTemporaryDirectory TempDir;
auto RootDirectory = TempDir.Path();