Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leaks in src_vol #1644

Merged
merged 1 commit into from
Jul 1, 2021
Merged

Fix memory leaks in src_vol #1644

merged 1 commit into from
Jul 1, 2021

Conversation

ahoenselaar
Copy link
Contributor

@ahoenselaar ahoenselaar commented Jun 28, 2021

The old implementation's weak point was the add_to method, which
sometimes transferred memory ownership correctly and sometimes did not.

  • Rewrite src_vol using STL containers.
  • Replace the linked list of source volumes in fields_chunk with a
    vector. Adjust code that iterates over source volumes accordingly.
  • Exclude fields_chunk from SWIG wrappers.

@ahoenselaar ahoenselaar force-pushed the srcvol branch 2 times, most recently from 13357a4 to db519de Compare June 28, 2021 19:43
@ahoenselaar ahoenselaar marked this pull request as ready for review June 28, 2021 19:53
@ahoenselaar
Copy link
Contributor Author

#1605

ahoenselaar added a commit to ahoenselaar/meep that referenced this pull request Jun 28, 2021
Along with NanoComp#1644, this shuld get us into a position where the
AddressSanitizer workflow succeeds.
stevengj pushed a commit that referenced this pull request Jun 30, 2021
Along with #1644, this shuld get us into a position where the
AddressSanitizer workflow succeeds.
src/meep_internals.hpp Outdated Show resolved Hide resolved
The old implementation's weak point was the `add_to` method, which
sometimes transferred memory ownership correctly and sometimes did not.

* Rewrite `src_vol` using STL containers.
* Replace the linked list of source volumes in `fields_chunk` with a
vector. Adjust code that iterates for source volumes accordingly.
* Exclude `fields_chunk` from SWIG wrappers.
@stevengj stevengj merged commit 3936d35 into NanoComp:master Jul 1, 2021
bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
Along with NanoComp#1644, this shuld get us into a position where the
AddressSanitizer workflow succeeds.
bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
The old implementation's weak point was the `add_to` method, which
sometimes transferred memory ownership correctly and sometimes did not.

* Rewrite `src_vol` using STL containers.
* Replace the linked list of source volumes in `fields_chunk` with a
vector. Adjust code that iterates for source volumes accordingly.
* Exclude `fields_chunk` from SWIG wrappers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants