|
|
|
|
|
by jstimpfle
5 days ago
|
|
It's totally true, using sizeof like a function is one of my pet peeves. Even the kernel people do it but it's WRONG and you are right. But ACSHUALLY, how you write allocation is like this #define sane_alloc(type, count) ((type *) malloc(sizeof (type) * (count)))
game->boardPieces = sane_alloc(BoardPiece, row * column);
The kernel people seem to finally have figured out this one in 2026. |
|