Skip to content

Conversation

@ZackPierce
Copy link
Contributor

Previously the done-state of generated rust encoders and decoders handed back a reference to the wrapped data buffer and a the final position read/written to. Now only the final position is provided.

This ensures that it is impossible for the mutable references data struct overlays optionally created during encoding to coexist with a same-lifetime'd mutable byte slice produced at the end. Since the final position is still returned, and the original input buffers were all slice-references anyhow, users should be able to trivally re-slice the source data equivalently themselves without loss of functionality.

A minor performance gain is also accomplished because returning a usize is marginally cheaper than returning a newly-allocated tuple containing a usize and a slice-reference.

@mjpt777

@tmontgomery tmontgomery merged commit c856547 into aeron-io:master Oct 4, 2017
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.

2 participants