Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
moya-mmoczala committed Jan 3, 2022
1 parent eca1c29 commit e15fb49
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 194 deletions.
9 changes: 4 additions & 5 deletions Allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class MemoryPool
Buffer *firstBuffer = nullptr;
std::size_t bufferedBlocks = growSize;


public:

MemoryPool() = default;
Expand Down Expand Up @@ -82,7 +81,7 @@ class MemoryPool
template <class T, std::size_t growSize = 1024>
class Allocator : private MemoryPool<T, growSize>
{
#ifdef _WIN32
#if defined(_WIN32) && defined(ENABLE_OLD_WIN32_SUPPORT)
Allocator *copyAllocator = nullptr;
std::allocator<T> *rebindAllocator = nullptr;
#endif
Expand All @@ -103,7 +102,7 @@ class Allocator : private MemoryPool<T, growSize>
typedef Allocator<U, growSize> other;
};

#ifdef _WIN32
#if defined(_WIN32) && defined(ENABLE_OLD_WIN32_SUPPORT)
Allocator() = default;

Allocator(Allocator &allocator) :
Expand All @@ -126,7 +125,7 @@ class Allocator : private MemoryPool<T, growSize>

pointer allocate(size_type n, const void *hint = 0)
{
#ifdef _WIN32
#if defined(_WIN32) && defined(ENABLE_OLD_WIN32_SUPPORT)
if (copyAllocator)
return copyAllocator->allocate(n, hint);

Expand All @@ -142,7 +141,7 @@ class Allocator : private MemoryPool<T, growSize>

void deallocate(pointer p, size_type n)
{
#ifdef _WIN32
#if defined(_WIN32) && defined(ENABLE_OLD_WIN32_SUPPORT)
if (copyAllocator) {
copyAllocator->deallocate(p, n);
return;
Expand Down
62 changes: 31 additions & 31 deletions Allocator.sln
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Allocator", "Allocator.vcxproj", "{35A51081-1318-4884-B394-D2DEC9415601}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{35A51081-1318-4884-B394-D2DEC9415601}.Debug|x64.ActiveCfg = Debug|x64
{35A51081-1318-4884-B394-D2DEC9415601}.Debug|x64.Build.0 = Debug|x64
{35A51081-1318-4884-B394-D2DEC9415601}.Debug|x86.ActiveCfg = Debug|Win32
{35A51081-1318-4884-B394-D2DEC9415601}.Debug|x86.Build.0 = Debug|Win32
{35A51081-1318-4884-B394-D2DEC9415601}.Release|x64.ActiveCfg = Release|x64
{35A51081-1318-4884-B394-D2DEC9415601}.Release|x64.Build.0 = Release|x64
{35A51081-1318-4884-B394-D2DEC9415601}.Release|x86.ActiveCfg = Release|Win32
{35A51081-1318-4884-B394-D2DEC9415601}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2F72DF30-C240-45A0-9CDE-E33186A20AB1}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Allocator", "Allocator.vcxproj", "{35A51081-1318-4884-B394-D2DEC9415601}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{35A51081-1318-4884-B394-D2DEC9415601}.Debug|x64.ActiveCfg = Debug|x64
{35A51081-1318-4884-B394-D2DEC9415601}.Debug|x64.Build.0 = Debug|x64
{35A51081-1318-4884-B394-D2DEC9415601}.Debug|x86.ActiveCfg = Debug|Win32
{35A51081-1318-4884-B394-D2DEC9415601}.Debug|x86.Build.0 = Debug|Win32
{35A51081-1318-4884-B394-D2DEC9415601}.Release|x64.ActiveCfg = Release|x64
{35A51081-1318-4884-B394-D2DEC9415601}.Release|x64.Build.0 = Release|x64
{35A51081-1318-4884-B394-D2DEC9415601}.Release|x86.ActiveCfg = Release|Win32
{35A51081-1318-4884-B394-D2DEC9415601}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2F72DF30-C240-45A0-9CDE-E33186A20AB1}
EndGlobalSection
EndGlobal
Loading

0 comments on commit e15fb49

Please sign in to comment.