-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit overhauls deallocation in both gridded and non-gridded modes. In ST_main.c * Added a boolean parameter to deallocate_Globals. * Wrapped some of the variables in an if statement dependent on the parameter. I did this because in gridded mode these pointers do not allocate any memory, but in non-gridded mode they do. In sxw.c: * Removed free_sxw_memory, _deallocate_memory, and load_sxw_memory * I removed free_sxw_memory because it overcomplicated the code. It's only call was in free_all_sxw_memory, so I combined them to make the code more readable. * I removed load_sxw_memory because it is depreciated, and referenced free_sxw_memory which I had already deleted. * I removed _deallocate_memory because it was redundant and unused. * In free_all_sxw_memory I went through each struct and deallocated every pointer to ensure no memory is leaked. * I did NOT delete SXW->f_files because it is never actually allocated memory. The previous call to Mem_Free(SXW->f_files.in) worked because it pointed to another variable which is allocated, but calling the function multiple times in gridded mode revealed that it is unnecessary. In ST_grid.c: * Added a few additional pointers to _free_grid_memory. * Added a loop which loads in a cell, then calls the non-gridded mode deallocation function. This reduces code reuse.
- Loading branch information
chaukap
committed
Jun 17, 2019
1 parent
be91251
commit 010e678
Showing
3 changed files
with
41 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
010e678
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#322