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 using
			a local clone.
		
	dmd.nogc
Checks that a function marked @
nogc does not invoke the Garbage Collector.
Specification No-GC Functions
Authors: 
License: 
Source nogc.d
Documentation https://dlang.org/phobos/dmd_nogc.html
- classNOGCVisitor: dmd.visitor.StoppableVisitor;
- Look for GC-allocations
- boolsetGC(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:FuncDeclaration fdfunction Loc loclocation 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(FuncDeclarationfd, FuncDeclarationf);
- The function calls non-@nogc function f, mark it as not nogc.Parameters:FuncDeclaration fdfunction doin the call FuncDeclaration ffunction being called Returns:true if function is marked as @nogc, meaning a user error occurred
Copyright © 1999-2025 by the D Language Foundation | Page generated by
Ddoc on Mon Mar 31 10:27:59 2025