Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
noobermin
on Aug 27, 2022
|
parent
|
context
|
favorite
| on:
Ushering out strlcpy()
A waste of 8 bytes?
drran
on Aug 27, 2022
|
next
[–]
If we define `String` type as `{size_t len, size_t offset, char *data}`, then we can store up to 23 bytes directly in the struct, if we will sacrifice 1 bit of `len` field to indicate that.
Thiez
on Aug 27, 2022
|
prev
|
next
[–]
7, since keeping track of the length allows you to skip storing the trailing 0.
snickerbockers
on Aug 27, 2022
|
prev
[–]
Well technically that's implementation-defined, but yes.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: