[Bf-blender-cvs] [0d28e20bc32] functions: move possibly empty arrays to end of struct for msvc compatibility
Jacques Lucke
noreply at git.blender.org
Tue Jul 9 09:32:52 CEST 2019
Commit: 0d28e20bc32264b48b1399afd483eb09e2f914e8
Author: Jacques Lucke
Date: Tue Jul 9 09:32:35 2019 +0200
Branches: functions
https://developer.blender.org/rB0d28e20bc32264b48b1399afd483eb09e2f914e8
move possibly empty arrays to end of struct for msvc compatibility
===================================================================
M source/blender/blenlib/BLI_monotonic_allocator.hpp
M source/blender/blenlib/BLI_small_vector.hpp
===================================================================
diff --git a/source/blender/blenlib/BLI_monotonic_allocator.hpp b/source/blender/blenlib/BLI_monotonic_allocator.hpp
index 5672402bdf2..3fe30299107 100644
--- a/source/blender/blenlib/BLI_monotonic_allocator.hpp
+++ b/source/blender/blenlib/BLI_monotonic_allocator.hpp
@@ -15,13 +15,14 @@ namespace BLI {
template<uint N = 0> class MonotonicAllocator {
private:
- char m_small_buffer[N];
SmallVector<void *> m_pointers;
void *m_current_buffer;
uint m_remaining_capacity;
uint m_next_min_alloc_size;
+ char m_small_buffer[N];
+
public:
MonotonicAllocator()
: m_current_buffer((void *)m_small_buffer),
diff --git a/source/blender/blenlib/BLI_small_vector.hpp b/source/blender/blenlib/BLI_small_vector.hpp
index 3f743dd5e8f..64c2e7ee75e 100644
--- a/source/blender/blenlib/BLI_small_vector.hpp
+++ b/source/blender/blenlib/BLI_small_vector.hpp
@@ -51,10 +51,10 @@ template<typename T> void uninitialized_relocate_n(T *src, uint n, T *dst)
template<typename T, uint N = 4> class SmallVector {
private:
- char m_small_buffer[sizeof(T) * N];
T *m_elements;
uint m_size = 0;
uint m_capacity = N;
+ char m_small_buffer[sizeof(T) * N];
public:
/**
More information about the Bf-blender-cvs
mailing list