Граф коммитов

13 Коммитов

Автор SHA1 Сообщение Дата
Kenta Murata 7e69296a2b
memory_view.c: Add rb_memory_view_extract_item_members (#3855) 2020-12-08 02:01:31 +09:00
Kenta Murata 60eabb1aa7
Revert "memory_view.c: Add rb_memory_view_extract_item_members"
This reverts the following three commits.

- ce707079c1
- 1a76bb56b0
- 51500eedef
2020-12-07 00:38:19 +09:00
Kenta Murata ce707079c1
memory_view.c: suppress uninitialized warning 2020-12-07 00:19:25 +09:00
Kenta Murata 51500eedef
memory_view.c: Add rb_memory_view_extract_item_members 2020-12-06 22:46:06 +09:00
Kenta Murata c0de997edd
memory_view.c: Fix endianness of n, N, v, V 2020-12-04 15:07:07 +09:00
Kenta Murata 82dc0c6aa3
memory_view.c: Check availability in rb_memory_view_get 2020-12-02 09:44:03 +09:00
Kenta Murata 73a337e214
Keep references of memory-view-exported objects (#3816)
* memory_view.c: remove a reference in view->obj at rb_memory_view_release

* memory_view.c: keep references of memory-view-exported objects

* Update common.mk

* memory_view.c: Use st_update
2020-11-30 14:53:13 +09:00
Nobuyoshi Nakada 5a77e90fe8
Use rb_intern_const instead of rb_intern in Init functions
```
find . -name \*.o -exec nm {} + |&
sed '/Init_.*\.rbimpl_id/!d;s/^.* b //;s/\.[1-9][0-9]*$//;s/\.rbimpl_id$//' |
uniq
```
should be empty.
2020-10-21 12:46:53 +09:00
卜部昌平 ae94c5bf5d STRUCT_ALIGNOF: use RUBY_ALIGNOF
This was a workaround for RUBY_ALIGNOF's glitch, which has already been
fixed.  See also https://github.com/ruby/ruby/pull/3570
2020-10-06 14:20:10 +09:00
卜部昌平 7d594399f6 memory_view.h: use bool
Because `bool` is already used in the header there is no reason to
hesitate.
2020-10-06 14:20:10 +09:00
Kenta Murata c827cacde1
memory_view.c: Use ssize_t for ndim in memory_view (#3615)
* memory_view.c: Use ssize_t for ndim in memory_view

* include/ruby/memory_view.h: Fix the type of item_size argument
2020-10-02 08:04:25 +09:00
Kenta Murata 8119e5b0e6
memory_view.c: prevent "warning: instance variable __memory_view__ not initialized" 2020-09-25 23:56:38 +09:00
Kenta Murata 890bc2cdde
Buffer protocol proposal (#3261)
* Add buffer protocol

* Modify for some review comments

* Per-object buffer availability

* Rename to MemoryView from Buffer and make compilable

* Support integral repeat count in memory view format

* Support 'x' for padding bytes

* Add rb_memory_view_parse_item_format

* Check type in rb_memory_view_register

* Update dependencies in common.mk

* Add test of MemoryView

* Add test of rb_memory_view_init_as_byte_array

* Add native size format test

* Add MemoryView test utilities

* Add test of rb_memory_view_fill_contiguous_strides

* Skip spaces in format string

* Support endianness specifiers

* Update documentation

* Support alignment

* Use RUBY_ALIGNOF

* Fix format parser to follow the pack format

* Support the _ modifier

* Parse count specifiers in get_format_size function.

* Use STRUCT_ALIGNOF

* Fix test

* Fix test

* Fix total size for the case with tail padding

* Fix rb_memory_view_get_item_pointer

* Fix rb_memory_view_parse_item_format again
2020-09-25 20:32:02 +09:00