annotation ReturnsTwice

Overview

Indicates that the annotated method or function can return twice.

The C setjmp function is an example of a function that returns twice: once right after being called, and once again whenever the matching longjmp is invoked.

The compiler disables some optimizations (like tail calls) in the caller of these functions.

NOTE The Crystal book has a section about Built-in Annotations: ReturnsTwice.

Defined in:

annotations.cr