Add explicit cast from size_t to u64.

Fixes compile error on non-64-bit targets.