Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So creating a pointer to a type with a fixed length and a sentinel and creating a new one will automatically allocate enough for the length + the sentinel? That's nice.

I'm still not sure I like the .len 'misreporting' since it would be harder to manually optimize around, e.g. packing a struct with a 8 byte + sentinel array would take 16 bytes that I might not notice if I am going by `.len`. This is all speculation, though. I need to actually play around with Zig.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: