Skip to Main content Skip to Navigation
Books

Defer Mechanism for {C}

Abstract : The defer mechanism can restore a previously known property or invariant that is altered during the processing of a code block. The defer mechanism is useful for paired operations, where one operation is performed at the start of a code block and the paired operation is performed before exiting the block. Because blocks can be exited using a variety of mechanisms, operations are frequently paired incorrectly. The defer mechanism in C is intended to help ensure the proper pairing of these operations. This pattern is common in resource management, synchronization, and outputting balanced strings (e.g., parenthesis or HTML). A separable feature of the defer mechanism is a panic/recover mechanism that allows error handling at a distance.
Document type :
Books
Complete list of metadatas

https://hal.inria.fr/hal-02953399
Contributor : Jens Gustedt <>
Submitted on : Wednesday, September 30, 2020 - 10:33:28 AM
Last modification on : Wednesday, October 14, 2020 - 3:58:48 AM

Identifiers

  • HAL Id : hal-02953399, version 1

Citation

Aaron Ballman, Alex Gilding, Jens Gustedt, Tom Scogland, Robert Seacord, et al.. Defer Mechanism for {C}. ISO TC1/SC22/WG14, pp.57, 2020. ⟨hal-02953399⟩

Share

Metrics

Record views

24