You are viewing a single thread.
View all comments View context
1 point

As a user of any higher level data structures there’s no way for you to know what happens to values passed though. You’re absolutely right that if you were using nothing but the stdlib you always know (mostly) that you are explicitly calling forget.

The problem is that you don’t know that to be the case as the consumer of a library without a thorough audit of the library. Especially when dealing with ffis things get very muddy very fast.

permalink
report
parent
reply
1 point

Especially when dealing with ffis things get very muddy very fast.

True. But an ffi biding API leaking resources (memory or otherwise) is a bug in that binding. This holds true for any RAII-using language, including C++. I don’t think faulty Drop implementations have anything to do with the subjects covered by the article!

permalink
report
parent
reply

Rust

!rust@programming.dev

Create post

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits
  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

Community stats

  • 572

    Monthly active users

  • 887

    Posts

  • 3.9K

    Comments