Changelog
Source:NEWS.md
Rtinycc 0.1.11
- Fix
PROTECTand memory-balance hygiene bugs in internal C state initialization (RC_libtcc_state_new,RC_libtcc_get_symbol, and callback registration paths). Previously, class string attributes could be inadvertently allocated without proper protection. - Fix a stack-depth and protection imbalance bug in
RC_invoke_callback_internalwhere callback execution could unexpectedly unprotect thecallobject prior to evaluation.
Rtinycc 0.1.10
CRAN release: 2026-04-27
Fix installation on musl-based Linux systems, including Alpine Linux, by enabling TinyCC’s musl configuration when a musl libc environment is detected during configure.
Fix configure failure on macOS oldrel arm64 (Big Sur, clang 14). The bundled TinyCC Makefile pairs
-flat_namespacewith-undefined warningon clang older than 15. The package strips-flat_namespaceon macOS to avoid TinyCC SIGSEGV behavior under flat namespace, but on clang < 15 that left-undefined warningon its own, which the modern macOS linker rejects under the default-twolevel_namespace. The configure step now also strips-undefined warningso thelibtcc.dyliblink succeeds on the CRAN macOS oldrel arm64 builder.
Rtinycc 0.1.9
CRAN release: 2026-04-27
Replace the upstream
make installstep with explicit copies of the build artifacts (tcc,libtcc.{a,dylib,so},libtcc1.a,libtcc.h, and the bundled tinycc C headers underlib/tcc/include/). This sidesteps BSD/GNUinstalldifferences and the strictinstall-unxmacros in the upstream Makefile that cause configuration to fail on macOS arm64 and x86_64 CRAN builders. The installed layout underinst/tinycc/is unchanged.On Linux, prefer the unversioned
libm.soGNU ld script over the bare versioned SONAME (libm.so.6) when resolving the system math runtime in vignettes and tests. TinyCC handles GNU ld scripts directly, which avoids link failures on Fedora-style toolchains.Make the external-library linking example in tests and the “Linking External Libraries” vignette skip cleanly when
tcc_link()cannot resolve the platform math runtime, instead of erroring the whole run.Skip runtime benchmark vignette chunks that depend on memory profiling when the running R was built without
Rprofmem(), avoiding vignette rebuild failures on platforms built without memory profiling support.Add a CRAN version badge to the README.
Rtinycc 0.1.8
CRAN release: 2026-04-24
- Clean up vignette sources by removing package-attachment checks and replacing hidden
library(Rtinycc)setup with explicit namespace bindings, while keeping executable examples working during vignette builds.
Rtinycc 0.1.7
Add missing return-value documentation across exported helpers and print methods so generated reference pages consistently describe result class, meaning, or side-effect-only behavior.
Update vignettes to ensure each article executes ordinary R code during builds, and correct conservative type-mapping docs so
const char *examples reflect the defaultptrmapping.
Rtinycc 0.1.6
- Exclude the top-level
scripts/directory more explicitly from package builds to avoid CRAN notes about non-standard top-level contents.
Rtinycc 0.1.5
Fix Debian CRAN incoming failures around external-library linking. Short linker names now stay on the normal linker-name path, and the Unix math-library vignette/test examples now resolve a real runtime library file robustly on both Linux and macOS.
Improve external library discovery by searching relevant loader and linker environment paths in addition to the built-in platform library path tables.
Improve vignette rendering of generated C code by reusing the package’s custom knitr C rendering path so highlighted generated code matches other vignette C blocks.
Clean up README rendering around nested-struct and bitfield limitations.
Add a Docker helper for reproducing a Debian R-devel CRAN-style check locally.
Rtinycc 0.1.4
Tighten FFI soundness around ownership, helper generation, and nested composite views. Generated wrappers now route pointer and composite wrapper creation through host-side helpers more consistently, borrowed/unowned pointer semantics are enforced more strictly, and callback/SEXP/pointer wrapper invariants are covered with stronger codegen and runtime tests.
Clarify and extend helper semantics across structs, unions, enums, globals, bitfields, and treesitter-derived bindings. Helper metadata now records both helper family and helper operation more explicitly, bitfield and constant helpers are distinguished from ordinary field helpers, and named nested struct helper accessors support borrowed nested views plus copy-in setters.
Improve cross-platform robustness for generated external-pointer/finalizer paths and Windows diagnostics, including host-side registration helpers, tighter smoke tests, and CI/debug workflow coverage for the historical Windows GC/finalizer crash path.
Refresh README, vignettes, and generated reference documentation so the user docs match current FFI semantics for pointers, callbacks, bitfields, nested helpers, and treesitter-derived accessor behavior.
Rtinycc 0.1.3
Tighten FFI boundary handling for wide integers and pointers. Generated wrappers, struct accessors, typed memory writers, and callback return paths now warn or error more consistently when
i64/u64values cannot be represented exactly in R numeric vectors, and typed pointer offsets are now validated as non-negative whole numbers instead of truncating throughint.Extend async callback support so
i64,u32, andu64arguments use the same numeric marshaling path as async returns, with matching documentation of the2^53exactness limit for R doubles.Update array and callback code generation to avoid repeated evaluation in an additional
cstringboxing path, use read-onlycharacter_arrayaccess viaSTRING_PTR_RO()when available, and improve callback pointer classification for non-string pointer types.Clarify user-facing documentation for callback limits and draining behavior,
character_arraysemantics, serialization of external pointers, and the benchmark vignette’s zero-length array-return example.Fix FFI return code generation so array,
cstring,i64, andu64return expressions are evaluated once before boxing/copying. This avoids repeated calls in generated wrappers for side-effectful expressions.Declare the temporary
cstringreturn variable asconst char*so the generated wrapper acceptsconst char*-returning C functions without a const-discarding assignment. This restores vignette builds on macOS and Windows (bundled TinyCC treated the implicit const-discard as a fatal diagnostic rather than a warning).Add regression tests for repeated-evaluation bugs in generated FFI return code.
Add
make vigandmake vig-mddevelopment targets for rebuilding HTML package vignettes and Markdown vignette exports.Add an internal knitr engine for reusable C chunks in vignettes, adapted from the
callmepackage, and use it in the benchmark vignette. The executablecallmecomparisons now degrade gracefully when the build environment cannot compile the temporary helper DLL, which restores passing package checks on Windows CI.
Rtinycc 0.1.1
Fix C compiler warnings in the package sources by using strict prototypes for zero-argument routines and explicit initialization for async callback result structs.
Remove compiler-specific diagnostic pragmas from the host-symbol registration path so package checks no longer report pragma usage notes.
Rework the benchmark documentation so temporary
callmeDLLs are created, benchmarked, and unloaded within helper scopes. This reduces the risk of Windows vignette-build failures caused by lingering loaded modules.
Rtinycc 0.1.0
Add variadic FFI support in
tcc_bind()with both legacy typed-tail mode (variadic = TRUE,varargs) and bounded dynamic-tail mode (variadic = TRUE,varargs_types,varargs_min,varargs_max).Refactor FFI codegen and callbacks to use lambda.r guard rules instead of long
if/elseorswitchchains. This keeps type-mapping logic centralized inR/aaa_ffi_codegen_rules.R, makes behavior easier to extend, and reduces duplication across codegen sites.Reduce shutdown-related crash risk by using
onexit = FALSEfor registered external-pointer finalizers, so cleanup runs during normal garbage collection rather than during R process teardown. This change is part of the Windows stabilization work and complements explicit ownership tracking forTCCState*wrappers.Treesitter helper examples are now wrapped in
\dontrun{}and the treesitter helper tests are skipped on Windows to avoid process-exit crashes related totreesitter.ccleanup.Experimental Windows support. The package now builds and passes
R CMD checkon Windows (Rtools 4.5 / UCRT). The Windows build compiles TinyCC from source, dynamically linkslibtcc.dll, and includes the compatibility glue needed for R’s UCRT runtime. Async callbacks andfork()-based parallelism remain Unix-only.RC_invoke_callback_id()replaces thesnprintf-based callback dispatch. The trampoline now passes the callback token as an integer directly, eliminating a round-trip through string conversion that relied onsnprintf(unavailable as a direct symbol on Windows/UCRT).Add new user documentation for core FFI semantics, internals, external library linking, treesitter-based header parsing, and benchmark-oriented comparisons against a conventional
.Call()workflow.
Rtinycc 0.0.3
Add typed memory read/write helpers inspired by Bun’s FFI and the ctypesio package:
tcc_read_i8(),tcc_read_u8(),tcc_read_i16(),tcc_read_u16(),tcc_read_i32(),tcc_read_u32(),tcc_read_i64(),tcc_read_u64(),tcc_read_f32(),tcc_read_f64(),tcc_read_ptr()and correspondingtcc_write_*()functions. All operate at a byte offset and usememcpyinternally for alignment safety.Legacy vectorised interface preserved:
tcc_read_u8(ptr, n = 4),tcc_read_i32(ptr, n = 2), andtcc_read_f64(ptr, n = 2)continue to work alongside the new scalar offset API.Fix macOS “undefined symbol” errors at relocation time.
RC_libtcc_add_host_symbols()explicitly registers host symbols (RC_free_finalizer,RC_invoke_callback,RC_callback_async_schedule_c) viatcc_add_symbol()beforetcc_relocate().Fix macOS library linking: short library names like
"m"that cannot be resolved to a file path are now passed through as-l<name>to the linker instead of erroring.Fix
stdbool.hnot found on macOS:tcc_set_lib_path()now receives the correctlib/tccdirectory so TCC resolves its own headers via{B}/include.tcc_compiledobjects now surviveserialize()/unserialize()andsaveRDS()/readRDS(). The FFI recipe is stored inside the compiled object; on first access after deserialization,$.tcc_compileddetects the dead TCC state pointer and recompiles transparently.Compiled FFI objects are fork-safe:
parallel::mclapply()and otherfork()-based parallelism work out of the box since TCC’s compiled code lives in memory mappings that survivefork()via copy-on-write.
Rtinycc 0.0.2
- Update package title and description
- Mark this as the first release with API versioning going forward
Rtinycc 0.0.1.9000 (development version)
- Generate callback trampolines from
callback:<signature>bindings so C APIs can accept function pointers directly - Add
callback_async:<signature>for thread-safe scheduling on the main thread - Callback errors now warn and return type-appropriate defaults (avoid longjmp)
- Update README examples for callbacks, async callbacks, enums, and bitfields
- Fix potential exit-time segfaults by using a package-level finalizer (
RC_free_finalizer) for generated struct/union helpers instead of JIT-local finalizers - Add treesitter.c helpers (
tcc_treesitter_functions(),tcc_treesitter_structs(),tcc_treesitter_bindings()) aligned with Rtinycc type mappings - Require treesitter.c (>= 0.0.3) for header parsing helpers
- Add global getter/setter helpers via
tcc_global()with generatedglobal_<name>_get()andglobal_<name>_set()accessors - BREAKING: struct/union helper names now use
struct_<name>_*andunion_<name>_*prefixes (including bitfields) - Add
tcc_generate_bindings()and expanded tree-sitter helpers for enum/union/global parsing and binding generation - Add pointer utilities:
tcc_null_ptr(),tcc_malloc(),tcc_free(),tcc_read_*()helpers, pointer-to-pointer utilities (tcc_data_ptr(),tcc_ptr_set(),tcc_ptr_free_set_null()), and ownership checks viatcc_ptr_is_owned() - Tag external pointers as owned/borrowed and guard frees based on ownership
- Add array field element helpers for structs (
struct_<name>_get_<field>_elt()/struct_<name>_set_<field>_elt()) - Add array return specifications in
tcc_bind()viareturns = list(type = "*_array", length_arg = ..., free = TRUE)
Rtinycc 0.0.0.9000 (development version)
- Added a bun:ffi inspired FFI API
- Add R callback API:
tcc_callback(),tcc_callback_ptr(),tcc_callback_close()with trampoline support for passing R functions to compiled C code - Add structured type support: declarative
tcc_struct()andtcc_union()with generated allocation/accessor helpers and introspection (sizeof/alignof) - Bitfield support (compiled by TinyCC and exposed via accessors) and improved type mappings (scalars, zero-copy arrays, pointers)
- Modify configure script to alter tinycc Makefile to remove flat_namespace option on macOS
- add simple return type for tcc_call_symbol