Skip to content

ABI: implement the pinned native StringBuilder boundary #210

Description

@chrisbbreuer

Parent: #140
Profile parents: #163 and #164

Implement the complete caller-owned native StringBuilder boundary shared by the pinned Home and Bun private-JSC profiles.

Symbols

  • StringBuilder__init
  • StringBuilder__deinit
  • StringBuilder__ensureUnusedCapacity
  • StringBuilder__appendLatin1
  • StringBuilder__appendUtf16
  • StringBuilder__appendString
  • StringBuilder__appendLChar
  • StringBuilder__appendUChar
  • StringBuilder__appendInt
  • StringBuilder__appendUsize
  • StringBuilder__appendDouble
  • StringBuilder__appendQuotedJsonString
  • StringBuilder__toString

Acceptance

  • Match the pinned 24-byte, 8-byte-aligned caller-owned storage ABI and deterministic init/deinit lifetime.
  • Preserve exact UTF-16 content across Latin-1, UTF-16, BunString, LChar, and UChar inputs, including astral pairs and lone surrogates.
  • Match pinned integer, usize, and double formatting, including signed zero, NaN, and infinities.
  • Match JSON quoting for controls, quotes, backslashes, astral characters, and unpaired surrogates.
  • Make capacity arithmetic and allocation failure sticky and failure-atomic; surface OOM from toString without replacing an existing exception.
  • Return an exact JS string in the selected realm and keep repeated toString calls non-destructive.
  • Exercise malformed/null boundary inputs without stale pointers or double frees.
  • Add focused unit/runtime-fixture coverage, update both inventories and profile docs, and publish the new implemented/pending counts in README.md.

Backward compatibility is not a constraint before the first consumer release; prefer the cleanest exact boundary.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions