Raw pointers are more complicated in Rust than C

62 points Alexevier1

As said in the title i find raw pointers to be more complicated in Rust than C.
There are more hops, in c a malloc(\bytes\) is enough but in rust i need a Layout before calling alloc or realloc and the documentation doesn't specify if in realloc(.., new\_size) means the bytes or the quantity multiplied by the size inside the layout.

I know that rust is more safe but this is suposed to be more advanced rust, is it nescessary to add the extra hops?

I need to say that i still learning to code and my first languaje was C++ with similar smart\_pointers as rust but i don't understand why the extra steps in a section that is suposed to be advanced anyway.

Im loving rust when i don't need to access the lower level side.

Im working on a sdl-wrapper and wanted to implement a particles system in rust since it has trait objects and i could store multiple different ones in the same array and have an asegured inteface.

Sorry for my bad english...