write uint instead of u64 to be platform-dependent.