Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
kkdwivedi
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
kkdwivedi
6y ago
Right, totally depends on what you're doing. My example is not a good fit for intrusive use cases.
2.
▲
by
kkdwivedi
6y ago
Another option is a struct with a FAM at the end. typedef struct { size_t len; uint8_t data[]; } ByteBuf; Then, allocation becomes ByteBuf *b = malloc(sizeof(*b) + sizeof(uint8_t) * array_size); b->len = array_