Thread overview | |||||
---|---|---|---|---|---|
|
December 16, 2011 [Issue 7120] New: Scope Delegates + Delegate Literals | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=7120 Summary: Scope Delegates + Delegate Literals Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Keywords: performance Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: dsimcha@yahoo.com --- Comment #0 from David Simcha <dsimcha@yahoo.com> 2011-12-16 11:23:57 PST --- The following code apparently heap-allocates a closure even though doNothing() takes a scope delegate. This happens when doNothing() is passed a delegate literal. When it's passed the address of a named inner function, no heap allocation takes place. import core.memory; void main() { GC.disable(); foreach(j; 0..1_000_000_000) { doIt(); } } void doIt() { int i; doNothing(() { i++; }); } void doNothing(scope void delegate() dg) { dg(); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 02, 2012 [Issue 7120] Scope Delegates + Delegate Literals | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Simcha | http://d.puremagic.com/issues/show_bug.cgi?id=7120 Kenji Hara <k.hara.pg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch --- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-01-02 01:22:04 PST --- https://github.com/D-Programming-Language/dmd/pull/598 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 06, 2012 [Issue 7120] Scope Delegates + Delegate Literals | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Simcha | http://d.puremagic.com/issues/show_bug.cgi?id=7120 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |FIXED --- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2012-01-06 10:41:20 PST --- https://github.com/D-Programming-Language/dmd/commit/f19992a6ac4dde4d16db61104bebc9303173518d https://github.com/D-Programming-Language/dmd/commit/21ce18fbc1241d4fbe06c2d78dd2114c4924b35a -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation