Skip to content

Add MemoryView.export and MemoryView#release - #80

Merged
kou merged 2 commits into
masterfrom
memory-view-release
Jun 17, 2021
Merged

Add MemoryView.export and MemoryView#release#80
kou merged 2 commits into
masterfrom
memory-view-release

Conversation

@kou

@koukou commented Jun 16, 2021

Copy link
Copy Markdown
Member

fix#79

Users can release memory views explicitly before process exit.

Reported by xtkoba. Thanks!!!

fix#79
Users can release memory views explicitly before process exit.
Reported by xtkoba. Thanks!!!
@kou
kou requested a review from mrknJune 16, 2021 20:41
@mrkn

mrkn commented Jun 17, 2021

Copy link
Copy Markdown
Member

I think these two methods are useful. But, it seems less clear that get with a block implicitly releases the memory view at the end of the block. I want to change the name of get if we can find a more appropriate name.

@kou

kou commented Jun 17, 2021

Copy link
Copy Markdown
MemberAuthor

get is borrowed from rb_memory_view_get_func_t.

Other candidates:

  • MemoryView.open: like File.open but MemoryView doesn't open anything
  • MemoryView.acquire: release and acquire pair is often used in "lock" context but the current context isn't "lock"
  • MemoryView.map
  • MemoryView.view

@kou

kou commented Jun 17, 2021

Copy link
Copy Markdown
MemberAuthor

We choose MemoryView.export.

@koukou changed the title Add MemoryView.get and MemoryView#releaseAdd MemoryView.export and MemoryView#releaseJun 17, 2021
@kou
kou merged commit 1de64b7 into masterJun 17, 2021
@kou
kou deleted the memory-view-release branch June 17, 2021 04:36
matzbot pushed a commit to ruby/ruby that referenced this pull request Jul 13, 2021
…le#80)
fixruby/fiddle#79
Users can release memory views explicitly before process exit.
Reported by xtkoba. Thanks!!!
ruby/fiddle@1de64b7e76
Sign up for freeto 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.

Segfault when exiting due to Fiddle::MemoryView

2 participants

@kou@mrkn