Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/memcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Install valgrind
run: sudo apt-get install valgrind
run: sudo apt-get update && sudo apt-get install valgrind
- name: Set up Ruby 3.4
uses: ruby/setup-ruby@v1
with:
Expand Down
14 changes: 12 additions & 2 deletions ext/numo/narray/narray.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
#include <assert.h>
#include <ruby.h>

#ifndef RBASIC_FLAGS
#define RBASIC_FLAGS(obj) (RBASIC(obj)->flags)
#endif

#ifndef RBASIC_SET_FLAGS
#define RBASIC_SET_FLAGS(obj, flags_to_set) (RBASIC(obj)->flags = (flags_to_set))
#endif

/* global variables within this module */
VALUE numo_cNArray;
VALUE rb_mNumo;
Expand Down Expand Up @@ -852,8 +860,10 @@ void na_copy_flags(VALUE src, VALUE dst) {
na2->flag[0] = na1->flag[0];
// na2->flag[1] = NA_FL1_INIT;

RBASIC(dst)->flags |= (RBASIC(src)->flags) & (FL_USER1 | FL_USER2 | FL_USER3 | FL_USER4 |
FL_USER5 | FL_USER6 | FL_USER7);
RBASIC_SET_FLAGS(
dst, RBASIC_FLAGS(dst) | (RBASIC_FLAGS(src) & (FL_USER1 | FL_USER2 | FL_USER3 | FL_USER4 |
FL_USER5 | FL_USER6 | FL_USER7))
);
}

// fix name, ex, allow_stride_for_flatten_view
Expand Down