Skip to content

Add write::CountingBuffer#930

Merged
philipc merged 1 commit into
gimli-rs:mainfrom
philipc:write-buffer
Jul 2, 2026
Merged

Add write::CountingBuffer#930
philipc merged 1 commit into
gimli-rs:mainfrom
philipc:write-buffer

Conversation

@philipc

@philipc philipc commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Move all position tracking from WritableBuffer into CountingBuffer.
This allows WritableBuffer to be implemented for &mut [u8], which can
then be used for elf::Encoder and macho::Encoder. This may also make it
possible to support appending to a non-empty Vec, but I haven't allowed
that yet.

This removes WritableBuffer::len and WritableBuffer::resize.

Also move WritableBuffer::write_pod and write_pod_slice to a new
WritableBufferExt trait. This also replaces the write/write_slice
methods that were implemented for dyn WritableBuffer, as well as
some internal freestanding functions.

Move all position tracking from WritableBuffer into CountingBuffer.
This allows WritableBuffer to be implemented for &mut [u8], which can
then be used for elf::Encoder and macho::Encoder. This may also make it
possible to support appending to a non-empty Vec, but I haven't allowed
that yet.

This removes WritableBuffer::len and WritableBuffer::resize.

Also move WritableBuffer::write_pod and write_pod_slice to a new
WritableBufferExt trait. This also replaces the write/write_slice
methods that were implemented for dyn WritableBuffer, as well as
some internal freestanding functions.
@philipc philipc merged commit 32066cf into gimli-rs:main Jul 2, 2026
10 checks passed
@philipc philipc deleted the write-buffer branch July 2, 2026 02:27
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