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

Consider redesign of MemoryReader.release and MemoryWriter.release #378

Closed
CommanderTvis opened this issue Jul 5, 2021 · 7 comments
Closed

Comments

@CommanderTvis
Copy link
Collaborator

No description provided.

@altavir
Copy link
Member

altavir commented Jul 5, 2021

I agree, but I do not have any clear ideas about what to do with them. I think it will be more clear when we have some kind of prototype of working with native or memory-mapped blocks.

@CommanderTvis
Copy link
Collaborator Author

Well, current usages of Memory inside the library rely on that off-heap memory is managed by GC.

@CommanderTvis
Copy link
Collaborator Author

CommanderTvis commented Jul 5, 2021

So, we have either to carefully use such objects like MemoryBuffer inside certain scopes or not to use really native memory without any hacks like Cleaner.

@CommanderTvis
Copy link
Collaborator Author

CommanderTvis commented Jul 5, 2021

I agree, but I do not have any clear ideas about what to do with them. I think it will be more clear when we have some kind of prototype of working with native or memory-mapped blocks.

An obvious prototype of using managed native objects is kmath-gsl.

@altavir
Copy link
Member

altavir commented Jul 5, 2021

We need this interface to be usable both for managed and for non-managed memory. So there should be some kind of either release method or strict scoping policy. It does not make a lot of sense for only managed memory. I am not quite sure right now, but I think that there should be a release method like it is now, and the scoping rules should be built on top of it.

@CommanderTvis
Copy link
Collaborator Author

Maybe we should separate managed memory for things like MemoryBuffer from manual one?

@CommanderTvis CommanderTvis self-assigned this Jul 5, 2021
@CommanderTvis CommanderTvis removed their assignment Nov 10, 2021
@CommanderTvis
Copy link
Collaborator Author

Closing because of #432

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants