Iterator Element Ownership Protocol

6 sections

0%
Overview

Establish a uniform element ownership contract for the C iterator runtime protocol: every element yielded by IterState::next() is owned (+1 RC) by the consumer. Consumers dec after use; adapters that discard elements dec before discarding. This eliminates BUG-05-003 (leaked owned elements from map/flat_map adapters) and the broader class of borrow-vs-own ambiguity bugs across all 11 consumer functions, 11 adapter variants, and the AIMS analysis pipeline.

Planned

6 sections