Skip to content

Latest commit

 

History

History
43 lines (27 loc) · 1.63 KB

0114-buffer-naming.md

File metadata and controls

43 lines (27 loc) · 1.63 KB

Updating Buffer "Value" Names to "Header" Names

Introduction

This proposal updates parameters and generic type parameters from value names to header names for ManagedBuffer, ManagedProtoBuffer, and ManagedBufferPointer.

All user-facing Swift APIs must go through Swift Evolution. While this is a trivial API change with an existing implementation, this formal proposal provides a paper trail as is normal and usual for this process.

Swift Evolution Thread

Patch

Motivation

This change introduces better semantics for buffer types.

Detailed Design

This update affects ManagedBuffer, ManagedProtoBuffer, and ManagedBufferPointer.

Generic Parameters

The generic parameters <Value, Element> become <Header, Element> in affected classes.

Type Members

Each use of value or Value in type members is renamed to header or Header. Affected members include

  • header: Header
  • _headerPointer, _headerOffset
  • withUnsafeMutablePointerToHeader
  • create(minimumCapacity:makingHeaderWith:) -> Header
  • Initializers that refer to makingHeaderWith

Impact on Existing Code

Existing third party code will need migration using a simple fixit.

Alternatives Considered

Not Applicable