fix: convert ptr to int via intptr_t