|
|
|
|
|
by foota
338 days ago
|
|
Funny enough I recently wrote my own hack using this linker feature in C, to implement an array of static counter definitions that can be declared anywhere and then written out (e.g., to prometheus) in one place. Note that as I later found out, this doesn't work with Mac OS's linker, so you need to use some separate incantations for Mac OS. |
|
I call them "linker arrays". They are great when you need to globally register a set of things and the order between them isn't significant.