llnl / llnl/AMS

Move AMSMessage to smart pointer

Open
#111 0 comments 0 reactions 1 assignee View on GitHub

@lpottier is already working on this.

Since Mar 21, 2025.

Dominant language
C++
Stars
10
Forks
8
Avg merge
17d 21h
Merged PRs (30d)
1

Description

`AMSMessage` currently introduces a memory leak if it not used properly.
```c++
void foo() {
AMSMessage msg (...);
// code here...
} // msg._data is not freed here
```
But if you create a `shared_ptr` you are good:

```c++
void foo() {
AMSMessage msg (...);
std::shared_ptr ptr(msg.data());
} // msg._data is freed here
```

However, it is counterintuitive and not RAII.
Ideally, `msg._data` would be smart pointer from the beginning.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.