nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.22k stars 1.46k forks source link

fixes #23742; setLen(0) no longer allocates memory for uninitialized strs/seqs for refc #23745

Closed ringabout closed 1 week ago

ringabout commented 1 week ago

fixes #23742

Before my PR, setLen(0) doesn't free buffer if s != nil, but it allocated unnecessary memory for strs. This PR rectifies this behavior. setLen(0) no longer allocates memory for uninitialized strs/seqs

github-actions[bot] commented 1 week ago

Thanks for your hard work on this PR! The lines below are statistics of the Nim compiler built from 2bef08774f00692963f2a00243e4287caa7572ee

Hint: mm: orc; opt: speed; options: -d:release 179014 lines; 8.531s; 664.309MiB peakmem