On macOS we should use type aware memory allocators: https://developer.apple.com/documentation/xcode/adopting-type-aware-memory-allocation#Create-type-aware-allocator-wrappers . This is a very easy task and improves memory and type safety massively.