Skip to content

Commit ed46738

Browse files
committed
Changed default alignment to 8.
1 parent 182e120 commit ed46738

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/vsg/core/Allocator.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ namespace vsg
4141
class VSG_DECLSPEC Allocator
4242
{
4343
public:
44-
explicit Allocator(size_t in_defaultAlignment = 4) :
44+
explicit Allocator(size_t in_defaultAlignment = 8) :
4545
defaultAlignment(in_defaultAlignment) {}
46-
explicit Allocator(std::unique_ptr<Allocator> in_nestedAllocator, size_t in_defaultAlignment = 4) :
46+
explicit Allocator(std::unique_ptr<Allocator> in_nestedAllocator, size_t in_defaultAlignment = 8) :
4747
defaultAlignment(in_defaultAlignment), nestedAllocator(std::move(in_nestedAllocator)) {}
4848
virtual ~Allocator() {}
4949

@@ -76,7 +76,7 @@ namespace vsg
7676
virtual void report(std::ostream& out) const = 0;
7777

7878
mutable std::mutex mutex;
79-
size_t defaultAlignment = 4;
79+
size_t defaultAlignment = 8;
8080

8181
protected:
8282
// if you are assigning a custom allocator you must retain the old allocator to manage the memory it allocated and needs to delete

include/vsg/core/IntrusiveAllocator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ namespace vsg
4444
class VSG_DECLSPEC IntrusiveAllocator : public Allocator
4545
{
4646
public:
47-
explicit IntrusiveAllocator(size_t in_defaultAlignment = 4);
48-
explicit IntrusiveAllocator(std::unique_ptr<Allocator> in_nestedAllocator, size_t in_defaultAlignment = 4);
47+
explicit IntrusiveAllocator(size_t in_defaultAlignment = 8);
48+
explicit IntrusiveAllocator(std::unique_ptr<Allocator> in_nestedAllocator, size_t in_defaultAlignment = 8);
4949

5050
~IntrusiveAllocator();
5151

@@ -116,7 +116,7 @@ namespace vsg
116116
Element* memory = nullptr;
117117
Element* memoryEnd = nullptr;
118118

119-
size_t alignment = 4; // min aligment is 4 { sizeof(Element) }
119+
size_t alignment = 8; // min aligment is 4 { sizeof(Element) }
120120
size_t blockAlignment = 16;
121121
size_t blockSize = 0;
122122
size_t maximumAllocationSize = 0;
@@ -175,7 +175,7 @@ namespace vsg
175175

176176
IntrusiveAllocator* parent = nullptr;
177177
std::string name;
178-
size_t alignment = 4;
178+
size_t alignment = 8;
179179
size_t blockSize = 0;
180180
size_t maximumAllocationSize = 0;
181181
std::vector<std::shared_ptr<MemoryBlock>> memoryBlocks;

0 commit comments

Comments
 (0)