libocca / occa

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

modeMemoryPool_t::reserve bug #743

Open stgeke opened 8 months ago

stgeke commented 8 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 7 months ago

I was wrong. Current implementation is correct.

stgeke commented 7 months ago

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

kris-rowe commented 3 months ago

@stgeke Is this still an issue?

stgeke commented 3 months ago

Yeah, this needs to be fixed.