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

improvement for subbuffer #204

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

improvement for subbuffer #204

wants to merge 1 commit into from

Conversation

aleksander-mendoza
Copy link

Hey, I think you might like this improvement. At least I'd really love this being added, because without it the API is not safe and can crash when someone attempts to build sub-buffer of sub-buffer

@c0gent
Copy link
Member

c0gent commented Feb 21, 2023

Apologies for not responding to this sooner.

It's been a while since I've looked at this code. Any chance you could explain your changes?

After this much time you've probably forgotten too. Either way no worries and thanks anyway :)

@aleksander-mendoza
Copy link
Author

aleksander-mendoza commented Feb 22, 2023

This code caused crashes. It's been long time and I don't have the code that could reproduce this anymore but essentially if you try to make subbuffer of a subbuffer then core::create_sub_buffer calls some illegal operation and crashes (tried on OS X). My fix checks for this scenario and runs the correct sequence of functions. Instead of making subbuffer of subbuffer it creates a subbufer of the parent buffer with the appropriate offset being sum of parent offset and new subbufer offset.

@c0gent
Copy link
Member

c0gent commented Feb 25, 2023

Ok thanks much.

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

Successfully merging this pull request may close these issues.

3 participants