logoalt Hacker News

n_plus_1_accyesterday at 8:20 PM1 replyview on HN

This is also problematic, because there might be padding and the calculated size might be too small:

`malloc(sizeof(*node) + data_size);`


Replies

o11cyesterday at 8:42 PM

There's no a problem with the author's current code, since the padding is already included in the node size, but it would be a problem after doing alignment more intelligently.