Skip to content

Add lo_message_freeze() to cache a message's serialised form#187

Open
sl1200mk2 wants to merge 1 commit into
radarsat1:masterfrom
sl1200mk2:lo_message_freeze
Open

Add lo_message_freeze() to cache a message's serialised form#187
sl1200mk2 wants to merge 1 commit into
radarsat1:masterfrom
sl1200mk2:lo_message_freeze

Conversation

@sl1200mk2

Copy link
Copy Markdown
Contributor

Serialise a message once and cache the result in the lo_message, so repeated lo_send_message() calls with the same path send the cached bytes with no allocation or re-serialisation. With buf == NULL liblo owns the cache; otherwise the caller keeps ownership (allocation-free path). The cache is invalidated by any lo_message_add_*()/clear() and freed by lo_message_free(); a different path re-serialises transparently.

Implements the lo_message-centric approach discussed in #75. Only appends fields to the internal _lo_message, so it stays ABI-compatible. Adds the Windows .def export and a test_freeze() case.

Serialise a message once and cache the result in the lo_message, so
repeated lo_send_message() calls with the same path send the cached
bytes with no allocation or re-serialisation. With buf == NULL liblo
owns the cache; otherwise the caller keeps ownership (allocation-free
path). The cache is invalidated by any lo_message_add_*()/clear() and
freed by lo_message_free(); a different path re-serialises transparently.

Implements the lo_message-centric approach discussed in radarsat1#75. Only
appends fields to the internal _lo_message, so it stays ABI-compatible.
Adds the Windows .def export and a test_freeze() case.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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