Skip to content

Commit 17060f5

Browse files
committed
Use ffi_closure_free by default.
The current conditionals reflect historic heritage of FFI. Usage of ffi_closure_free should be better default nowadays.
1 parent ea06b28 commit 17060f5

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

ext/fiddle/closure.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,11 @@ typedef struct {
1313
ffi_type **argv;
1414
} fiddle_closure;
1515

16-
#if defined(USE_FFI_CLOSURE_ALLOC)
17-
#elif defined(__OpenBSD__) || defined(__APPLE__) || defined(__linux__)
18-
# define USE_FFI_CLOSURE_ALLOC 0
19-
#elif defined(RUBY_LIBFFI_MODVERSION) && RUBY_LIBFFI_MODVERSION < 3000005 && \
20-
(defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_AMD64))
21-
# define USE_FFI_CLOSURE_ALLOC 0
22-
#else
23-
# define USE_FFI_CLOSURE_ALLOC 1
16+
#ifndef USE_FFI_CLOSURE_ALLOC
17+
# if defined(RUBY_LIBFFI_MODVERSION) && RUBY_LIBFFI_MODVERSION < 3000005
18+
# define USE_FFI_CLOSURE_ALLOC 0
19+
# else
20+
# define USE_FFI_CLOSURE_ALLOC 1
2421
#endif
2522

2623
static void

0 commit comments

Comments
 (0)