2 ms·
Rc<T> is a chunk of memory you can only access through special versions of malloc and free. These don’t actually allocate new memory with the OS though, they ju
by Olreich 3y ago
Rc<T> is a chunk of memory you can only access through special versions of malloc and free. These don’t actually allocate new memory with the OS though, they just give you pointers to the memory and tell the memory management system that you’re done using it. Once everyone who has allocated that memory calls free, then the memory is actually given back to the OS. Box<T> is the same, except if you have multiple people try to call the special malloc it will fail to compile.