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

Remove obsolete code in DEBUG_MEM* sections #369

Closed
dschlaep opened this issue Aug 31, 2023 · 1 comment
Closed

Remove obsolete code in DEBUG_MEM* sections #369

dschlaep opened this issue Aug 31, 2023 · 1 comment

Comments

@dschlaep
Copy link
Member

DEBUG_MEM* sections of the SOILWAT2 code look like obsolete code – corresponding functionality (see comment at start of "mymemory.ch" has likely been replaced by third-party leak/memory analyzers (e.g., ASAN, leaks, valgrind)

DEBUG_MEM and DEBUG_MEM_X are currently not functional; the following all cause compilation errors

  • make clean bin_run CPPFLAGS="-DDEBUG"
  • make clean bin_run CPPFLAGS="-DDEBUG -DDEBUG_MEM"
  • make clean bin_run CPPFLAGS="-DDEBUG_MEM"
  • make clean bin_run CPPFLAGS="-DDEBUG -DDEBUG_MEM_X"
  • make clean bin_run CPPFLAGS="-DDEBUG_MEM_X"

The following is functional

  • make clean bin_run CPPFLAGS="-DSWDEBUG -DDEBUG_MEM_LOG"

--> Consider if we can remove these obsolete code sections to increase code maintainability and ease for future developments.

@dschlaep
Copy link
Member Author

STEPWAT2 has not been utilizing "DEBUG_MEM" -- we have to go ahead to remove associated code.

@dschlaep dschlaep changed the title Evaluate need for code in DEBUG_MEM* sections Remove obsolete code in DEBUG_MEM* sections Sep 11, 2023
@dschlaep dschlaep added this to the Release v7.2.0 milestone Sep 11, 2023
dschlaep added a commit that referenced this issue Sep 26, 2023
Remove obsolete code in DEBUG_MEM* sections

close #369
dschlaep added a commit that referenced this issue Oct 13, 2023
- see commit 4e07625 "Merge pull request #371 from DrylandEcology/feature_remove_debug_mem"

see #369
dschlaep added a commit that referenced this issue Oct 24, 2023
Release/devel v7.2.0

* SOILWAT2 now handles errors more gracefully (#346; @N1ckP3rsl3y, @dschlaep).
    * Code no longer crashes on error immediately (except for STEPWAT2).
    * Code stores messages of warnings and error status.
    * All functions now check for errors and return early
      (after cleaning up memory).

* SOILWAT2 now defines its own structure for random numbers (#373; @dschlaep).
  This allows to hide implementation details, i.e., STEPWAT2 will no
  longer need to interact directly with `pcg` and rSOILWAT2 will no longer
  depend on `pcg` which it never has used.

* New `sw_strtok()` is thread-safe and replaces not thread-safe `strtok()`
  (#376; @N1ckP3rsl3y).

* Obsolete code in DEBUG_MEM* sections is removed (#369; @dschlaep).
dschlaep added a commit to DrylandEcology/STEPWAT2 that referenced this issue Oct 24, 2023
….2.0

Updates for SOILWAT2 v7.2.0

(see https://github.com/DrylandEcology/SOILWAT2/releases/tag/v7.2.0)

* Simulation output remains the same as the previous version.

* SOILWAT2 updated handling of warnings and errors (but functionality for STEPWAT2 is identical, i.e., immediate crash on error) ([SOILWAT2 issue 368](DrylandEcology/SOILWAT2#368)).

* SOILWAT2 now offers `sw_random_t` for random numbers and internalizes all uses of `pcg` ([SOILWAT2 issue 373](DrylandEcology/SOILWAT2#373)).

* Obsolete code in DEBUG_MEM* sections is removed ([SOILWAT2 issue 369](DrylandEcology/SOILWAT2#369)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant