Skip to content

Allow native aggregate fields named buffer and byteOffset #1032

Closed

Description

@frostney

Summary

Allow FFI structure and union descriptors to preserve native field names buffer and byteOffset without colliding with aggregate-value metadata.

Why

These are ordinary C field names. Raylib 6.0's AudioStream.buffer must currently be renamed to nativeBuffer in generated JavaScript, with a separate alias table to recover the native name. See the merged binding documentation.

Current behavior

On current main (34cc32f):

FFI.struct({ buffer: "pointer" });

Creation throws:

FFI aggregate field name is reserved: buffer

byteOffset is rejected the same way.

Current-source evidence:

The fresh-main FFI suite passes in interpreted and bytecode modes (92 tests, 337 assertions), confirming the collision is intentional current behavior.

Expected behavior

Generated FFI aggregates should expose the exact native fields buffer and byteOffset while retaining an unambiguous way to access backing-buffer metadata. The solution should preserve nested-view and detached-buffer safety.

Scope notes

Activity

  1. added
    new featureNew feature or request
    runtimeTGocciaRuntime: optional host extensions (console, fetch, JSON5, FFI, test assertions, etc.)
    on Jul 24, 2026
  2. added this to the 0.11.0 milestone on Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    new featureNew feature or requestruntimeTGocciaRuntime: optional host extensions (console, fetch, JSON5, FFI, test assertions, etc.)

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions