News for hackers. Stuff that matters.
Re:Why Is C Faster Than Java (2009) by unwind on Monday December 27, 2021 @07:16AM (#29701867)
Cool!

From a very quick look, the sample code prints 'r' instead of 'str' which was confusing. Also, is 'str' leaked or freed with 'r'?

Re:Why Is C Faster Than Java (2009) by josephg on Monday December 27, 2021 @04:08PM (#29706799)
In the C example str is heap allocated, so it’s not associated with r and leaked in that example. I should free it to make that clear!

After writing a lot of rust code this year it’s sort of weird reading that, and seeing that aspect of the code not be explicit or obvious.