From: andrea.ribuoli@... Date: 2020-12-01T06:32:09+00:00 Subject: [ruby-core:101173] [Ruby master Feature#17356] Alignment of memory allocated through Fiddle struct's malloc Issue #17356 has been updated by AndreaRibuoli (Andrea Ribuoli). Right now the change I have introduced manually is fine for me. I was wondering if there was a simple way to #ifdef the change in the macro invocation in `gc.c` so that I can re-introduce it easily in future releases by setting a define. Obviously this make sense if there is someone else that could benefit from using it! The value to be defined while compiling could be used to determine the alignment. Rather than the actual alignment the value to be set could be the exponent k, so that alignment is defined as 2^k. The support of a mechanism consistent with GC sounds complex. Should you decide to introduce it I will obviously be available for testing in my environment. Thanks for your kindness, Andrea ---------------------------------------- Feature #17356: Alignment of memory allocated through Fiddle struct's malloc https://bugs.ruby-lang.org/issues/17356#change-88859 * Author: AndreaRibuoli (Andrea Ribuoli) * Status: Open * Priority: Normal ---------------------------------------- I am testing a low-level patch for **Ruby 3** that inside *gc.c* replaces: `TRY_WITH_GC(size, mem = malloc(size));` with: `TRY_WITH_GC(size, mem = aligned_alloc(16,size));` This should allow me to control that Fiddle returns pointers quad-words aligned. Is it possible to introduce a configure parameter to control this kind of setting? Refer to [issue opened on Fiddle](https://github.com/ruby/fiddle/issues/53). Kind regards, Andrea Ribuoli -- https://bugs.ruby-lang.org/ Unsubscribe: