From c4a7f91d56d1ac851a704b57be52b255570396a2 Mon Sep 17 00:00:00 2001 From: IlushaShurupov Date: Sun, 23 Jul 2023 15:26:18 +0300 Subject: [PATCH] New placement header --- Allocators/public/Allocators.hpp | 3 --- Allocators/public/NewPlacement.hpp | 6 ++++++ CommandLine/private/CmdLineInterpreter.cpp | 2 ++ CommandLine/private/CommandLine.cpp | 1 + CommandLine/tests/TestCommandLine.cpp | 2 ++ CommandLine/tests/TestInterpreter.cpp | 2 ++ CommandLine/tests/Tests.cpp | 2 +- Connection/private/LocalConnection.cpp | 2 ++ Connection/tests/TestLocal.cpp | 2 ++ Containers/tests/Buffer2DTest.cpp | 1 + Containers/tests/BufferTest.cpp | 1 + Containers/tests/ListTest.cpp | 1 + Containers/tests/MapTest.cpp | 1 + Containers/tests/TreeTest.cpp | 1 + Strings/private/Logging.cpp | 1 + Strings/tests/TestsStrings.cpp | 1 + Strings/tests/TestsStringsLogic.cpp | 1 + Tokenizer/tests/TestTokenizer.cpp | 2 ++ 18 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 Allocators/public/NewPlacement.hpp diff --git a/Allocators/public/Allocators.hpp b/Allocators/public/Allocators.hpp index 9cb8b48..0283c52 100644 --- a/Allocators/public/Allocators.hpp +++ b/Allocators/public/Allocators.hpp @@ -11,9 +11,6 @@ namespace tp { extern ModuleManifest gModuleAllocators; } -inline void* operator new(std::size_t aSize, void* aWhere) noexcept { return aWhere; } -inline void* operator new[](std::size_t aSize, void* aWhere) noexcept { return aWhere; } - void* operator new(std::size_t aSize); void* operator new[](std::size_t aSize); void operator delete(void* aPtr) noexcept; diff --git a/Allocators/public/NewPlacement.hpp b/Allocators/public/NewPlacement.hpp new file mode 100644 index 0000000..c76af8f --- /dev/null +++ b/Allocators/public/NewPlacement.hpp @@ -0,0 +1,6 @@ +#pragma once + +#include "Common.hpp" + +inline void* operator new(std::size_t aSize, void* aWhere) noexcept { return aWhere; } +inline void* operator new[](std::size_t aSize, void* aWhere) noexcept { return aWhere; } diff --git a/CommandLine/private/CmdLineInterpreter.cpp b/CommandLine/private/CmdLineInterpreter.cpp index d3b0e40..e7b6cca 100644 --- a/CommandLine/private/CmdLineInterpreter.cpp +++ b/CommandLine/private/CmdLineInterpreter.cpp @@ -1,3 +1,5 @@ +#include "NewPlacement.hpp" + #include "CmdLineInterpreter.hpp" #define MAX_LINE_LENGTH 1024 diff --git a/CommandLine/private/CommandLine.cpp b/CommandLine/private/CommandLine.cpp index d0bd51a..f937e2a 100644 --- a/CommandLine/private/CommandLine.cpp +++ b/CommandLine/private/CommandLine.cpp @@ -1,3 +1,4 @@ +#include "NewPlacement.hpp" #include "CommandLine.hpp" diff --git a/CommandLine/tests/TestCommandLine.cpp b/CommandLine/tests/TestCommandLine.cpp index a6ccd55..bbc5ceb 100644 --- a/CommandLine/tests/TestCommandLine.cpp +++ b/CommandLine/tests/TestCommandLine.cpp @@ -1,3 +1,5 @@ +#include "NewPlacement.hpp" + #include "Tests.hpp" using namespace tp; diff --git a/CommandLine/tests/TestInterpreter.cpp b/CommandLine/tests/TestInterpreter.cpp index eb00474..c32777f 100644 --- a/CommandLine/tests/TestInterpreter.cpp +++ b/CommandLine/tests/TestInterpreter.cpp @@ -1,3 +1,5 @@ +#include "NewPlacement.hpp" + #include "Tests.hpp" #include "CmdLineInterpreter.hpp" diff --git a/CommandLine/tests/Tests.cpp b/CommandLine/tests/Tests.cpp index 9322365..81b3595 100644 --- a/CommandLine/tests/Tests.cpp +++ b/CommandLine/tests/Tests.cpp @@ -1,7 +1,7 @@ +#include "NewPlacement.hpp" #include "Tests.hpp" - int main() { tp::ModuleManifest* deps[] = { &tp::gModuleUtils, &tp::gModuleTokenizer, nullptr }; diff --git a/Connection/private/LocalConnection.cpp b/Connection/private/LocalConnection.cpp index eb791ff..cd6f90c 100644 --- a/Connection/private/LocalConnection.cpp +++ b/Connection/private/LocalConnection.cpp @@ -1,3 +1,5 @@ +#include "NewPlacement.hpp" + #include "LocalConnection.hpp" #include "bindings/Disk.hpp" diff --git a/Connection/tests/TestLocal.cpp b/Connection/tests/TestLocal.cpp index 0f004e6..0732de4 100644 --- a/Connection/tests/TestLocal.cpp +++ b/Connection/tests/TestLocal.cpp @@ -1,4 +1,6 @@ +#include "NewPlacement.hpp" + #include "LocalConnection.hpp" #include "Testing.hpp" diff --git a/Containers/tests/Buffer2DTest.cpp b/Containers/tests/Buffer2DTest.cpp index 5a4804a..5afe95b 100644 --- a/Containers/tests/Buffer2DTest.cpp +++ b/Containers/tests/Buffer2DTest.cpp @@ -1,3 +1,4 @@ +#include "NewPlacement.hpp" #include "Tests.hpp" #include "Testing.hpp" diff --git a/Containers/tests/BufferTest.cpp b/Containers/tests/BufferTest.cpp index 9c485a2..a9f1adc 100644 --- a/Containers/tests/BufferTest.cpp +++ b/Containers/tests/BufferTest.cpp @@ -1,3 +1,4 @@ +#include "NewPlacement.hpp" #include "Tests.hpp" #include "Buffer.hpp" diff --git a/Containers/tests/ListTest.cpp b/Containers/tests/ListTest.cpp index 69dfc07..e23deb4 100644 --- a/Containers/tests/ListTest.cpp +++ b/Containers/tests/ListTest.cpp @@ -1,3 +1,4 @@ +#include "NewPlacement.hpp" #include "Tests.hpp" #include "Testing.hpp" diff --git a/Containers/tests/MapTest.cpp b/Containers/tests/MapTest.cpp index f0cccbb..d5ce1f7 100644 --- a/Containers/tests/MapTest.cpp +++ b/Containers/tests/MapTest.cpp @@ -1,3 +1,4 @@ +#include "NewPlacement.hpp" #include "Tests.hpp" #include "Testing.hpp" diff --git a/Containers/tests/TreeTest.cpp b/Containers/tests/TreeTest.cpp index 561e410..5665342 100644 --- a/Containers/tests/TreeTest.cpp +++ b/Containers/tests/TreeTest.cpp @@ -1,3 +1,4 @@ +#include "NewPlacement.hpp" #include "Tests.hpp" #include "Tree.hpp" diff --git a/Strings/private/Logging.cpp b/Strings/private/Logging.cpp index f55f22b..34ec6df 100644 --- a/Strings/private/Logging.cpp +++ b/Strings/private/Logging.cpp @@ -1,3 +1,4 @@ +#include "NewPlacement.hpp" #include "Logging.hpp" diff --git a/Strings/tests/TestsStrings.cpp b/Strings/tests/TestsStrings.cpp index 1e8db8d..70f29cb 100644 --- a/Strings/tests/TestsStrings.cpp +++ b/Strings/tests/TestsStrings.cpp @@ -1,3 +1,4 @@ +#include "NewPlacement.hpp" #include "Tests.hpp" #include "Strings.hpp" diff --git a/Strings/tests/TestsStringsLogic.cpp b/Strings/tests/TestsStringsLogic.cpp index 231a790..747f2ab 100644 --- a/Strings/tests/TestsStringsLogic.cpp +++ b/Strings/tests/TestsStringsLogic.cpp @@ -1,3 +1,4 @@ +#include "NewPlacement.hpp" #include "Tests.hpp" #include "StringLogic.hpp" diff --git a/Tokenizer/tests/TestTokenizer.cpp b/Tokenizer/tests/TestTokenizer.cpp index 4fd38ae..fd53e5d 100644 --- a/Tokenizer/tests/TestTokenizer.cpp +++ b/Tokenizer/tests/TestTokenizer.cpp @@ -1,3 +1,5 @@ +#include "NewPlacement.hpp" + #include "Testing.hpp" #include "Tokenizer.hpp" #include