reactphysics3d
reactphysics3d copied to clipboard
Confused about the constructor in the `Array` container
Hi,
I was reading through the code of reactphysics3d, when I came across the following constructor:
Array(MemoryAllocator& allocator, uint64 capacity = 0)
: mBuffer(nullptr), mSize(0), mCapacity(0), mAllocator(allocator)
Why is mCapacity being initialized to 0 and not capacity? I tried changing to following:
Array(MemoryAllocator& allocator, uint64 capacity = 0)
: mBuffer(nullptr), mSize(0), mCapacity(capacity), mAllocator(allocator)
I get the access violation error thrown when running the tests. I am sorry if this is not the forum for asking such minor questions, but it is bothering me a lot. When the array is constructed without any capacity, shouldn't they be technically the same?
Thank you.