https://issues.dlang.org/show_bug.cgi?id=24393
Issue ID: 24393 Summary: Going into ROM operator overload Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: alphaglosi...@gmail.com When a block of memory goes into read only memory (cast or new), the operator overload ``opGoingIntoROM`` should be called upon it. Without this: - Classes cannot have optimizations that assume that the memory is actually immutable. As a result LDC does not apply it to ANY type causing performance problems. https://forum.dlang.org/post/dinugxopqgwrzobrf...@forum.dlang.org - Reference counting types cannot be immutable and therefore turn off reference counting. Otherwise segfaults if the memory is read only. --