summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-10-06 12:18:55 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-10-06 14:20:10 +0900
commit2d20e68fb716b3867beefd6b59b87a99fbfc256b (patch)
tree5230a6e8beaff4e16558534821755ca6523271ed /include
parent62ddbfe2b9fcadf201d8378fbd4bd53bcd3f7df1 (diff)
downloadruby-2d20e68fb716b3867beefd6b59b87a99fbfc256b.tar.gz
include/ruby/memory_view.h: annotate functions
Diffstat (limited to 'include')
-rw-r--r--include/ruby/memory_view.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/ruby/memory_view.h b/include/ruby/memory_view.h
index b88784815c..e3897f830e 100644
--- a/include/ruby/memory_view.h
+++ b/include/ruby/memory_view.h
@@ -118,9 +118,13 @@ RBIMPL_SYMBOL_EXPORT_BEGIN()
/* memory_view.c */
bool rb_memory_view_register(VALUE klass, const rb_memory_view_entry_t *entry);
+RBIMPL_ATTR_PURE()
bool rb_memory_view_is_row_major_contiguous(const rb_memory_view_t *view);
+RBIMPL_ATTR_PURE()
bool rb_memory_view_is_column_major_contiguous(const rb_memory_view_t *view);
+RBIMPL_ATTR_NOALIAS()
void rb_memory_view_fill_contiguous_strides(const ssize_t ndim, const ssize_t item_size, const ssize_t *const shape, const bool row_major_p, ssize_t *const strides);
+RBIMPL_ATTR_NOALIAS()
int rb_memory_view_init_as_byte_array(rb_memory_view_t *view, VALUE obj, void *data, const ssize_t len, const bool readonly);
ssize_t rb_memory_view_parse_item_format(const char *format,
rb_memory_view_item_component_t **members,
@@ -134,6 +138,7 @@ int rb_memory_view_release(rb_memory_view_t* memory_view);
RBIMPL_SYMBOL_EXPORT_END()
+RBIMPL_ATTR_PURE()
static inline bool
rb_memory_view_is_contiguous(const rb_memory_view_t *view)
{