Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix size of stringification buffers #172
This PR introduces some logic to calculate the buffer length needed for the stringification of everything. This is most impactful on Arrays and Deftypes, but has an impact on all primitives. This should both reduce the brittleness of Array and Deftype stringification, and reduce the memory footprint of Carp as a whole, since no wasteful bytes are allocated anymore.
First of all – this PR is awesome, I was scared of fixing the string allocations so thanks a lot for working through that!
Some minor feedback:
I'll make sure to add memory tests for the string functions as soon as I can, for now it seems like you got everything right – fingers crossed :)