Y
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
aktau
4365 days ago
And some methods for manipulating it (slicing it), and reference counting. And macro's for automatically ref'ing/unref'ing.
link
logicchains
4365 days ago
Reference counting? I didn't know reference counting was used with slices, I thought they just used the GC.
link
aktau
4365 days ago
Yes, but since C is not a GC-language, I thought I'd add that to reach more equivalence :).
link