Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modeMemoryPool_t::reserve bug #743

Open
stgeke opened this issue Mar 15, 2024 · 2 comments
Open

modeMemoryPool_t::reserve bug #743

stgeke opened this issue Mar 15, 2024 · 2 comments

Comments

@stgeke
Copy link
Contributor

stgeke commented Mar 15, 2024

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
Copy link
Contributor Author

stgeke commented Mar 25, 2024

I was wrong. Current implementation is correct.

@stgeke stgeke closed this as completed Mar 25, 2024
@stgeke
Copy link
Contributor Author

stgeke commented Mar 25, 2024

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

@stgeke stgeke reopened this Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant