Use size_t for memory length.