ruby-changes:63286
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Tue, 6 Oct 2020 14:20:31 +0900 (JST)
Subject: [ruby-changes:63286] 2d20e68fb7 (master): include/ruby/memory_view.h: annotate functions
https://git.ruby-lang.org/ruby.git/commit/?id=2d20e68fb7 From 2d20e68fb716b3867beefd6b59b87a99fbfc256b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= <shyouhei@r...> Date: Tue, 6 Oct 2020 12:18:55 +0900 Subject: include/ruby/memory_view.h: annotate functions diff --git a/include/ruby/memory_view.h b/include/ruby/memory_view.h index b88784815..e3897f8 100644 --- a/include/ruby/memory_view.h +++ b/include/ruby/memory_view.h @@ -118,9 +118,13 @@ RBIMPL_SYMBOL_EXPORT_BEGIN() https://github.com/ruby/ruby/blob/trunk/include/ruby/memory_view.h#L118 /* 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); https://github.com/ruby/ruby/blob/trunk/include/ruby/memory_view.h#L138 RBIMPL_SYMBOL_EXPORT_END() +RBIMPL_ATTR_PURE() static inline bool rb_memory_view_is_contiguous(const rb_memory_view_t *view) { -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/