Movatterモバイル変換


[0]ホーム

URL:


D Logo
Menu
Search

Library Reference

version 2.112.0

overview

Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinga local clone.

dmd.nogc

Checks that a function marked@nogc does not invoke the Garbage Collector.

SpecificationNo-GC Functions

Authors:
Walter Bright
License:
Boost License 1.0

Sourcenogc.d

Documentationhttps://dlang.org/phobos/dmd_nogc.html

Coveragehttps://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/nogc.d

classNOGCVisitor:dmd.visitor.StoppableVisitor;
Look for GC-allocations
boolsetGC(Scope*sc, FuncDeclarationfd, Locloc, const(char)*fmt, RootObject[]args...);
The function is doing something that may allocate with the GC, so mark it as not nogc (not no-how).
Parameters:
Scope*scscope that the GC action is in
FuncDeclarationfdfunction
Locloclocation of GC action
const(char)*fmtformat string for error message. Must include "%s%s" for the function kind and name.
RootObject[]argsarguments to format string
Returns:
true if function is marked as @nogc, meaning a user error occurred
boolsetGCCall(Scope*sc, FuncDeclarationfd, FuncDeclarationf);
The function calls non-@nogc function f, mark it as not nogc.
Parameters:
Scope*scscope that the GC action is in
FuncDeclarationfdfunction doing the call
FuncDeclarationffunction being called
Returns:
true if function is marked as @nogc, meaning a user error occurred
Copyright © 1999-2026 by theD Language Foundation | Page generated byDdoc on Sat Feb 21 00:05:01 2026

[8]ページ先頭

©2009-2026 Movatter.jp