The Rust allocator API requires a Layout struct to be passed into each of its functions. For example, to reallocate or free memory, you need to pass the pointer to the existing memory block and the layout used during its allocation. This is a problem when interacting with C API which does not provide any means of storing additional allocation data. The Cassandra C++ driver’s memory allocation functions is the example of such API, e.g. unsafeextern"C"fnrealloc(ptr: *mutc_void,size: usize)-> ...