8000 Buffer protocol proposal by mrkn · Pull Request #3261 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

Buffer protocol proposal #3261

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

Merged
merged 28 commits into from
Sep 25, 2020
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ff82d64
Add buffer protocol
mrkn Jun 26, 2020
add4635
Modify for some review comments
mrkn Jul 16, 2020
0a40fd8
Per-object buffer availability
mrkn Aug 24, 2020
185476f
Rename to MemoryView from Buffer and make compilable
mrkn Aug 24, 2020
12bc6ea
Support integral repeat count in memory view format
mrkn Aug 24, 2020
c97f9b8
Support 'x' for padding bytes
mrkn Aug 24, 2020
12dd500
Add rb_memory_view_parse_item_format
mrkn Aug 24, 2020
11426bc
Check type in rb_memory_view_register
mrkn Aug 24, 2020
ccbb0c9
Update dependencies in common.mk
mrkn Aug 25, 2020
a3b750e
Add test of MemoryView
mrkn Aug 25, 2020
aa6aaf1
Add test of rb_memory_view_init_as_byte_array
mrkn Aug 25, 2020
08c54b7
Add native size format test
mrkn Aug 25, 2020
0166ec6
Add MemoryView test utilities
mrkn Aug 28, 2020
51ee869
Add test of rb_memory_view_fill_contiguous_strides
mrkn Aug 28, 2020
934edd7
Skip spaces in format string
mrkn Sep 1, 2020
1b842a1
Support endianness specifiers
mrkn Sep 1, 2020
39a2a3f
Update documentation
mrkn Sep 1, 2020
01c3e0f
Support alignment
mrkn Sep 1, 2020
71800fc
Use RUBY_ALIGNOF
mrkn Sep 20, 2020
bdb94a0
Fix format parser to follow the pack format
mrkn Sep 20, 2020
72fee2b
Support the _ modifier
mrkn Sep 20, 2020
3d9bdce
Parse count specifiers in get_format_size function.
mrkn Sep 20, 2020
bff9105
Use STRUCT_ALIGNOF
mrkn Sep 21, 2020
cfad9fe
Fix test
mrkn Sep 22, 2020
be8a1ce
Fix test
mrkn Sep 23, 2020< 8000 /relative-time>
13de9f7
Fix total size for the case with tail padding
mrkn Sep 23, 2020
184fbef
Fix rb_memory_view_get_item_pointer
mrkn Sep 24, 2020
d264358
Fix rb_memory_view_parse_item_format again
mrkn Sep 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Check type in rb_memory_view_register
  • Loading branch information
mrkn committed Sep 25, 2020
commit 11426bc8c952a68edb78e7872cb87d48ae640eef
3 changes: 2 additions & 1 deletion memory_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ static const rb_data_type_t memory_view_entry_data_type = {
/* Register memory view functions for the given class */
bool
rb_memory_view_register(VALUE klass, const rb_memory_view_entry_t *entry) {
Check_Type(klass, T_CLASS);
VALUE entry_obj = rb_ivar_get(klass, id_memory_view);
if (! NIL_P(entry_obj)) {
rb_warning("Duplicated registration of memory_view to %"PRIsVALUE, klass);
rb_warning("Duplicated registration of memory view to %"PRIsVALUE, klass);
return 0;
}
else {
Expand Down
0