libocca / occa

Portable and vendor neutral framework for parallel programming on heterogeneous platforms.
https://libocca.org
MIT License
382 stars 81 forks source link

modeMemoryPool_t::reserve bug #743

Open stgeke opened 3 months ago

stgeke commented 3 months ago

I think https://github.com/libocca/occa/blob/main/src/occa/internal/core/memoryPool.cpp#L131 should be changed to:

} else {
-       resize(reserved + alignedBytes);
+      resize(offset + alignedBytes);
      return slice(reserved, bytes);
}
stgeke commented 3 months ago

I was wrong. Current implementation is correct.

stgeke commented 3 months ago

Actually, there is an issue for the corner case size == reserved + alignedBytes.