alloc: fix page header size calculation bug, increase type safety.