Skip to content

Commit

Permalink
Merge pull request #2104 from AllenInstitute/feature/2104-add_define_…
Browse files Browse the repository at this point in the history
…to_disable_wachecaching

Debug: Add define DISABLE_WAVECACHE to disable caching of waves
  • Loading branch information
t-b authored May 8, 2024
2 parents 4d399b8 + 1c2f6ff commit f6015b7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Packages/MIES/MIES_Cache.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,10 @@ threadsafe Function CA_StoreEntryIntoCache(key, val, [options])

variable index, storeDuplicate, foundIndex

#ifdef WAVECACHE_DISABLED
return NaN
#endif

if(ParamIsDefault(options))
storeDuplicate = 1
else
Expand Down Expand Up @@ -598,6 +602,10 @@ threadsafe Function/WAVE CA_TryFetchingEntryFromCache(key, [options])

variable index, returnDuplicate

#ifdef WAVECACHE_DISABLED
return $""
#endif

if(ParamIsDefault(options))
returnDuplicate = 1
else
Expand Down
10 changes: 10 additions & 0 deletions Packages/MIES/MIES_Debugging.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,16 @@ Function EnableThreadsafeSupport()
Execute/P/Q "SetIgorOption DisableThreadsafe=0"
End

/// @brief Disable wave caching support
Function DisableWaveCache()
Execute/P/Q "SetIgorOption poundDefine=WAVECACHE_DISABLED"
End

/// @brief Enable wave caching support again
Function EnableWaveCache()
Execute/P/Q "SetIgorOption poundUnDefine=WAVECACHE_DISABLED"
End

/// @brief Enable dangerous debugging (allows to call user-defined functions in the debugger)
Function EnableDangerousDebugging()

Expand Down
2 changes: 1 addition & 1 deletion Packages/igortest
2 changes: 2 additions & 0 deletions Packages/tests/Compilation/CompilationTester.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Function/WAVE GetDefines()
"TESTS_WITH_ITC1600_HARDWARE", \
"TESTS_WITH_ITC18USB_HARDWARE", \
"TESTS_WITH_NI_HARDWARE", \
"TESTS_WITH_SUTTER_HARDWARE", \
"WAVECACHE_DISABLED", \
"THREADING_DISABLED"}

SetDimensionLabelsFromWaveContents(defines)
Expand Down

0 comments on commit f6015b7

Please sign in to comment.