avoid allocation of closures - #23564
Conversation
DMD perf check
|
|
Unfortunately, inferring |
Ah, my breakpoint in the BumpGC didn't fire because it is not built with the old versions. So not a regression... |
- make delegates `scope` - capture parameters explicitly for local classes
|
Unfortunately, the diff here fails for hdrgen.d. It's mostly whitespace changes as functions had to be moved into the local class in toCBuffer, plus ref parameters buf and hgs have to be converted to pointers to capture them explicitly in the class. |
| extern (C++) | ||
| final class DsymbolPrettyPrintVisitor : Visitor |
There was a problem hiding this comment.
you should be able to keep the indentation level the same for most of the diff if you move this class outside of toCBuffer and move its definition to below the class
While debugging #23557 I noticed quite a few closure allocations happen during compilation. I guess these are unexpected in dmd, so let's get rid of them.
The assert in BumpGC.malloc triggers for such an allocation in debug builds, maybe it needs to be versioned for older host compiler versions or other backends that don't yet fully support the templated
new.