Use sizeof(intptr_t) instead of 4.