delegates & GC allocations

Etienne via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 20 07:44:38 PDT 2014


I've been hearing that delegates get a context pointer which will be 
allocated on the GC. Is this also true for delegates which stay in scope?

e.g.

void addThree() {
	int val;
	void addOne() {
		val++;
	}
	
	addOne();
	addOne();
	addOne();

	return val;
}

Will the above function allocate on the GC?


More information about the Digitalmars-d-learn mailing list