External link checkers are inherently flaky in CI due to
websites blocking automated requests (e.g. 403 errors).
Also remove JSON hooks (pretty-format-json, check-json)
since no JSON files remain in the repository.
Co-authored-by: Claude <noreply@anthropic.com>
Array literals were being built by loading all elements into registers
before constructing the array, requiring nregs proportional to the array
size (e.g. nregs=99 for 100 elements). This exceeds mruby/c's register
limit. Restore 3.4-era chunking at GEN_LIT_ARY_MAX (64) elements.
fixesmruby/mruby#6731
Co-authored-by: Claude <noreply@anthropic.com>
Since presym is now mandatory, mruby.h includes presym.h so that
MRB_SYM() macros are available everywhere without explicit include.
Remove redundant #include <mruby/presym.h> from all source files.
Co-authored-by: Claude <noreply@anthropic.com>
By performing output to presym files after header files, there is no longer a need to check for the existence of header files.
Furthermore, concentrating the file output logic into an "if" block eliminates the need for the `update` variable.
Strict atomicity between presym files and header files is still not guaranteed, as before.
If atomicity is truly required, it can be achieved by deleting the presym file before updating the header files.
update MRUBY_RUBY_VERSION to "4.0", MRUBY_RELEASE_MAJOR to 4,
MRUBY_RELEASE_MINOR to 0. update README.md references accordingly.
Co-authored-by: Claude <noreply@anthropic.com>
Inline L_DEF_METHOD body into OP_TDEF and OP_SDEF, making `tc`
(target class) a block-local variable in each case. This eliminates
the cross-case goto and frees one register at function scope.
`ch` (catch handler) cannot be scoped down because UNWIND_ENSURE
sets it before goto L_CATCH_TAGGED_BREAK where ch->target is
consumed (cross-goto flow requires function-scope visibility).
Co-authored-by: Claude <noreply@anthropic.com>
Amalgamated files include HAL gem source code selected at build time,
making them platform-specific. Document this as expected behavior.
Ref #6726.
Co-authored-by: Claude <noreply@anthropic.com>
Previously, explicit .o => presym.list_path dependencies were only
added for internal builds (mrbc sub-builds). When only a CrossBuild
is configured without an explicit Build.new, the implicit host build
is not internal, so its .o files had no ordering against presym header
generation. This caused "mruby/presym/id.h not found" errors when the
cross build's presym scanning triggered host compilation.
Fixes#6725.
Co-authored-by: Claude <noreply@anthropic.com>
On 32-bit platforms where alignof(int64_t) == 8 (ARM, MIPS, PowerPC,
RISC-V, MinGW), struct RBreak with MRB_USE_RBREAK_VALUE_UNION was 24
bytes (6 words) due to alignment padding before the union
mrb_value_union field. This exceeds the 5-word RVALUE limit, causing
a static assertion failure.
Replace union mrb_value_union with uint32_t[] storage (alignof == 4)
and use memcpy for value access. This gives exactly 20 bytes on all
32-bit platforms. Ref #6722
Co-authored-by: Claude <noreply@anthropic.com>
Organizes 22 doc files by audience (getting started, embedders,
contributors) so visitors can find the right document quickly.
Rendered automatically by GitHub when browsing the doc/ directory.
Co-authored-by: Claude <noreply@anthropic.com>
limitations.md: use consistent CRuby/mruby labels for remaining
entries that still had specific version strings.
language.md: add upfront summary of major CRuby differences so
porting developers see the key gotchas before reading the full doc.
capi.md: add table of contents for navigating the 800+ line
reference.
Co-authored-by: Claude <noreply@anthropic.com>
language.md: reorganize stdlib tables by class name instead of gem
name so users can quickly find "does mruby have Time/File/Set?"
capi.md: fix mrb_protect example (mrb->exc is cleared after protect,
so mrb_print_error does not work; show mrb_inspect instead); fix
fiber yield example to show correct usage as return value.
gc.md, compiler.md, vm.md: add "read this if" guidance paragraphs
to help developers decide whether they need each document.
Co-authored-by: Claude <noreply@anthropic.com>
Replace duplicated GC, compiler, and VM details with concise
summaries linking to gc.md, compiler.md, and vm.md.
Co-authored-by: Claude <noreply@anthropic.com>
Update CRuby/mruby version labels to generic names. Add sections for
refinements, Encoding, integer precision by boxing mode, and
ObjectSpace limitations.
Co-authored-by: Claude <noreply@anthropic.com>
Covers supported syntax, numeric types by boxing mode, core classes,
standard library gemboxes, and key differences from CRuby.
Co-authored-by: Claude <noreply@anthropic.com>
The old inspect_ary() function no longer exists. Replace with the
current mrb_ary_to_s() implementation from src/array.c.
Co-authored-by: Claude <noreply@anthropic.com>
Add sections on 64-bit inline float rotation encoding and 32-bit
RFloat heap allocation with char[] buffer for alignment safety.
Add comparison table of all three boxing modes and ABI note.
Co-authored-by: Claude <noreply@anthropic.com>
The power-of-10 normalization loop can leave f >= 10.0 when x87
extended precision (80-bit) produces different rounding than 64-bit
SSE2. This caused garbled output (e.g. "0.0,6.04*2000001e+19"
instead of "1.0e+20") because negative digit values were added to
'0'. Add a correction step after the loop, and clamp extracted
digits to [0,9] for robustness.
Co-authored-by: Claude <noreply@anthropic.com>
MRB_FL_OBJ_SHAPED uses bit 5 of flags, which on 32-bit conflicts
with Hash's ea_n_used field (bits 5-9). A Hash with entries would
falsely match MRB_OBJ_SHAPED_P, causing SEGV when its iv pointer
was misinterpreted as mrb_shaped_iv. Add tt == MRB_TT_OBJECT check
to the predicate.
Co-authored-by: Claude <noreply@anthropic.com>
The old name referred to "truncation" of float precision, which no
longer happens with rotation encoding. The new name describes the
actual behavior: disabling inline float encoding in word boxing.
The old name is kept as an obsolete alias for backward compatibility.
Co-authored-by: Claude <noreply@anthropic.com>
On 32-bit with MRB_WORDBOX_NO_FLOAT_TRUNCATE, RFloat stores a double
(8-byte alignment) but GC heap slots only guarantee 4-byte alignment.
Use char array + memcpy accessors to avoid misaligned access (SIGBUS
on MIPS, undefined behavior per C standard).
Co-authored-by: Claude <noreply@anthropic.com>
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>
Three new documents:
- doc/guides/getting-started.md: building, running, and embedding mruby
- doc/guides/capi.md: C API reference for values, classes, methods, etc.
- doc/internal/architecture.md: internal architecture for developers
Co-authored-by: Claude <noreply@anthropic.com>