Originally we used void* for calculations, but this is a GCC extension. I switched to uintptr_t, but then I was doing actual math. This meant that the startup code was calculating values incorrectly, and running 4x the actual functions that were supposed to be run.
For portability reasons, we keep the uintptr math, and then we convert back to the actual count of functions using shift operations.
Originally we used void* for calculations, but this is a GCC extension. I switched to uintptr_t, but then I was doing actual math. This meant that the startup code was calculating values incorrectly, and running 4x the actual functions that were supposed to be run.
For portability reasons, we keep the uintptr math, and then we convert back to the actual count of functions using shift operations.