Ruby 4.1.0dev (2026-10-09 revision e07ffd842ecde21a3731f68e7af5280d9fadc02d)
Macros
assume.h File Reference

(e07ffd842ecde21a3731f68e7af5280d9fadc02d)

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PRISM_ASSUME(expr_)   __builtin_assume(expr_)
 Tell the compiler that the given expression can be assumed to be true.
 

Macro Definition Documentation

◆ PRISM_ASSUME

#define PRISM_ASSUME (   expr_)    __builtin_assume(expr_)

Tell the compiler that the given expression can be assumed to be true.

Unlike assert, this emits no runtime check — it only feeds the optimizer's value range analysis so it can prune impossible paths. Use it to communicate an invariant the caller guarantees but that the compiler cannot otherwise prove.

Definition at line 14 of file assume.h.