smem: Use size_t for buffer sizes