Include <cstring> for memset and memcpy