Skip to content

Add checked range removal to Buffer #765

Closed

Description

@LunaStev

Motivation

Buffer can append, pop and truncate, but consuming a prefix or removing a middle range requires callers to move overlapping bytes and update len manually.

Starting points: std/buffer/write.wave, std/buffer/alloc.wave.

Scope

Add checked offset/count removal using overlap-safe movement. Retain capacity and ownership without allocating. Insertion, sorting and automatic shrinking are outside this task.

Difficulty: easy.

Completion criteria

  • Cover prefix, middle, suffix, entire-buffer and empty removals.
  • Reject invalid buffers, negative ranges and overflow/out-of-bounds requests.
  • Preserve bytes/len/cap on failure and verify remaining bytes after success at O0/O2.

Activity

  1. added
    enhancement
    good first issue
    needs testing
    on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issueneeds testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions