Skip to content

Commit f8bb2d9

Browse files
mrknkou
andauthored
memory_view.c: Rename private to private_data for C++ (#4812)
* memory_view.c: Rename private to private_data for C++ * doc/memory_view.md: Update document * Fix doc/memory_view.md Co-authored-by: Sutou Kouhei <kou@cozmixng.org> Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
1 parent a5e323f commit f8bb2d9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

doc/memory_view.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ The MemoryView structure consists of the following members.
8989
A `ndim` size array consisting of the offsets in each dimension when the MemoryView exposes a nested array.
9090
This can be `NULL` when the MemoryView exposes a flat array.
9191

92-
- `void *const private`
92+
- `void *private_data`
9393

9494
The private data that MemoryView provider uses internally.
9595
This can be `NULL` when any private data is unnecessary.

include/ruby/memory_view.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ typedef struct {
100100
const ssize_t *sub_offsets;
101101

102102
/* the private data for managing this exported memory */
103-
void *const private;
103+
void *private_data;
104104
} rb_memory_view_t;
105105

106106
typedef bool (* rb_memory_view_get_func_t)(VALUE obj, rb_memory_view_t *view, int flags);

memory_view.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ rb_memory_view_init_as_byte_array(rb_memory_view_t *view, VALUE obj, void *data,
210210
view->shape = NULL;
211211
view->strides = NULL;
212212
view->sub_offsets = NULL;
213-
*((void **)&view->private) = NULL;
213+
view->private_data = NULL;
214214

215215
return true;
216216
}

0 commit comments

Comments
 (0)