explicitly cast allocated memory