Skip to content

ossia: reuse value conversion storage - #202

Merged
jcelerier merged 1 commit into
mainfrom
ossia-value-conversion-allocations
Sep 7, 2026
Merged

jcelerier merged 1 commit into
mainfrom
ossia-value-conversion-allocations

Conversation

@jcelerier

Copy link
Copy Markdown
Member

Problem

The OSSIA conversion boundary builds temporary standard strings and containers even when the destination already owns compatible storage. Allocator-aware strings are also classified as vectors in some overload sets, and allocator-aware string-key maps are encoded as pair lists instead of OSSIA maps.

Changes

  • decode owning allocator-aware strings directly into their existing storage
  • preserve active variant string/map alternatives and their allocator/capacity
  • reuse native OSSIA list/map destination capacity when source and destination do not overlap
  • preserve snapshot semantics for nested source/destination aliasing
  • move converted list elements instead of copying them
  • encode allocator-aware string-key maps as OSSIA maps
  • disambiguate string and optimized numeric-vector output overloads
  • register the OSSIA conversion regression target when ossia::ossia is available

Verification

Built and ran tests/test_ossia_values.cpp directly against the score/libossia build configuration:

  • 9 test cases
  • 97 assertions
  • allocator-aware string/map ownership and embedded-NUL round trips
  • destination capacity reuse and bounded allocation counts
  • std::variant and boost::variant2 active-alternative reuse
  • nested native-container aliasing in both containment directions

Also rebuilt score_addon_jk, which exercises these conversions with allocator-aware jq values.

@jcelerier
jcelerier merged commit 136326a into main Sep 7, 2026
5 of 23 checks passed
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