Hacker News new | ask | show | jobs
by logicchains 4365 days ago
Isn't the C equivalent of a slice just a struct containing a *T, a length and a capacity?
1 comments

And some methods for manipulating it (slicing it), and reference counting. And macro's for automatically ref'ing/unref'ing.
Reference counting? I didn't know reference counting was used with slices, I thought they just used the GC.
Yes, but since C is not a GC-language, I thought I'd add that to reach more equivalence :).