mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mrbconf.h: prohibit MRB_INT64 on 32-bit with word/NaN boxing
Heap-allocated RInteger with int64_t requires 8-byte alignment, but GC heap slots on 32-bit may not guarantee it, causing SIGBUS on architectures like MIPS. MRB_NO_BOXING is still allowed since integers are stored inline in mrb_value (no heap RInteger). Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -86,6 +86,13 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* MRB_INT64 on 32-bit with word/NaN boxing causes alignment issues
|
||||
for heap-allocated RInteger (int64_t needs 8-byte alignment but
|
||||
GC heap slots may not guarantee it); use MRB_NO_BOXING instead */
|
||||
#if defined(MRB_INT64) && defined(MRB_32BIT) && !defined(MRB_NO_BOXING)
|
||||
#error "MRB_INT64 on 32-bit requires MRB_NO_BOXING"
|
||||
#endif
|
||||
|
||||
/* call malloc_trim(0) from mrb_full_gc() */
|
||||
//#define MRB_USE_MALLOC_TRIM
|
||||
|
||||
|
||||
Reference in New Issue
Block a user