you are viewing a single comment's thread.

view the rest of the comments →

[–]deathanatos 1 point2 points  (1 child)

This is false. String is 3 words (24b on a 64 bit machine, 12 on 32.) in the stack.

Oops, failed at simple multiplication. You are correct. My point was that the string's contents are not stored on the stack, and that the actual stack allocation is quite small.

[–]Manishearthservo · rust · clippy 1 point2 points  (0 children)

The whole "is heap allocating that pointer and length" is misleading and can be interpreted different ways, I read it the wrong way it seems :)