dlang-community / D-Scanner

Swiss-army knife for D source code
Boost Software License 1.0
238 stars 80 forks source link

add warnings for known useless / avoidable memory-allocations (especially in phobos) #929

Open WebFreak001 opened 10 months ago

WebFreak001 commented 10 months ago

Known useless extra allocations (can be removed without any downsides):

Known extra allocations that might be there for a reason:

WebFreak001 commented 10 months ago

cc @ljmf00 this might actually be something that should be trivial to implement in ldclint, where you could even accurately check for InputRange/ForwardRange and actually also warn on cases that D-Scanner wouldn't easily be able to tell apart and would just leave out to avoid false positives.

Although we are likely still going to implement this in D-Scanner anyway, with its not full accurate, but much less RAM using dsymbol index, while ldclint isn't fully ready to be used yet