Skip to content

ffi: name jsonrpc@1's decode allocation as a known exception - #61

Merged
Kinflou merged 1 commit into
mainfrom
ffi/doc-jsonrpc-alloc
Oct 26, 2026
Merged

Kinflou merged 1 commit into
mainfrom
ffi/doc-jsonrpc-alloc

Conversation

@Kinflou

@Kinflou Kinflou commented Oct 26, 2026

Copy link
Copy Markdown
Member

The C ABI says nothing allocates after comline_connection_new, with no exception. That's untrue on jsonrpc@1: feeding a frame can allocate inside serde_json. It does for any refused frame, an escaped member name, and brackets nested three deep (#58, deferred). The fuzz and differential driver already exempts exactly those cases (#57).

This states the exception where the rule is stated, until #58 is fixed:

  • the crate doc's rules;
  • comline_connection_new;
  • comline_connection_feed, and so comline.h (regenerated with cbindgen 0.29.2);
  • runtime/ffi/README.md.

Docs only, no code change.

…#58)

The rules said nothing allocates after comline_connection_new, with no
exception, but feeding a jsonrpc@1 frame can: serde_json allocates for a
refused frame, an escaped member name, and brackets three deep. The crate
doc, comline_connection_new, comline_connection_feed (and so comline.h)
and the README now say so until runtime#58 is fixed.
@Kinflou
Kinflou merged commit 2033847 into main Oct 26, 2026
24 checks passed
@Kinflou
Kinflou deleted the ffi/doc-jsonrpc-alloc branch October 26, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant