The functions were allocating arrays of `T *` rather than `T`, and then were reinterpret-casting to the correct type afterwards. This coincidentally worked at the current call sites because `T` was always a pointer type anyway, but the code was logically incorrect and wouldn't work if anyone tried to use them with a non-pointer `T`. This commit fixes this by correctly allocating an array of `T` instead, and removing the unnecessary cast. Pull Request: https://projects.blender.org/blender/blender/pulls/126656