Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • SWIFTsim SWIFTsim
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 58
    • Issues 58
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 23
    • Merge requests 23
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • SWIFT
  • SWIFTsimSWIFTsim
  • Merge requests
  • !211

Clean up allocations and deallocations

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Matthieu Schaller requested to merge clean_up_allocations into master Jul 31, 2016
  • Overview 4
  • Commits 4
  • Changes 13

Two improvements to the code:

  • Replaced all calls to alloca() by malloc() and posix_memalign() depending on use case.
  • Added cleaning up code to free up all the allocated memory.

The second change is there to make sure we don't have memory leaks by easing the read of the memory sanitizer output. There is only one allocation that cannot be easily freed at the end of a run. In space.c (line 1327) we allocate cells in batches and then use them as a linked list. No memory leak there, just a hard unnecessary work to clean up at the end of a run.

That allows to run the EAGLE_50 example for hundreds of steps.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: clean_up_allocations