diff options
Diffstat (limited to 'include/ruby/memory_view.h')
-rw-r--r-- | include/ruby/memory_view.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/include/ruby/memory_view.h b/include/ruby/memory_view.h index bac49e363e..42309d5afc 100644 --- a/include/ruby/memory_view.h +++ b/include/ruby/memory_view.h @@ -16,7 +16,7 @@ # include <stddef.h> /* size_t */ #endif -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include <sys/types.h> /* ssize_t */ #endif @@ -47,10 +47,10 @@ typedef struct { char format; /** :FIXME: what is a "native" size is unclear. */ - unsigned native_size_p: 1; + bool native_size_p; /** Endian of the component */ - unsigned little_endian_p: 1; + bool little_endian_p; /** The component's offset. */ size_t offset; @@ -146,8 +146,11 @@ typedef struct { * Or, NULL when this memory view exposes a flat array. */ const ssize_t *sub_offsets; - /** the private data for managing this exported memory */ + /** The private data for managing this exported memory */ void *private_data; + + /** DO NOT TOUCH THIS: The memory view entry for the internal use */ + const struct rb_memory_view_entry *_memory_view_entry; } rb_memory_view_t; /** Type of function of ::rb_memory_view_entry_t::get_func. */ @@ -160,9 +163,10 @@ typedef bool (* rb_memory_view_release_func_t)(VALUE obj, rb_memory_view_t *view typedef bool (* rb_memory_view_available_p_func_t)(VALUE obj); /** Operations applied to a specific kind of a memory view. */ -typedef struct { - - /** Exports a memory view from a Ruby object. */ +typedef struct rb_memory_view_entry { + /** + * Exports a memory view from a Ruby object. + */ rb_memory_view_get_func_t get_func; /** |