ScopeWith
Description
Open a scope that borrows an already-initialized allocator pointer. The pointer is exposed as MisraScope for the duration of the block. Nothing is destroyed on block exit - the caller still owns the allocator.
USAGE: typical helper pattern -
void my_helper(Vec(int) *v, Allocator *alloc) { ScopeWith(alloc) { Str scratch = StrInitFromCstr(“hi”, 2); StrDeinit(&scratch); } }
Usage example (Cross-references)
Usage examples (Cross-references)
No external code usages found in the scanned files.
Last updated on