# HG changeset patch # User Sebastien Jodogne # Date 1473232645 -7200 # Node ID 6a768d3b4c61423af50b9a8b74588708c640aae7 # Parent 03a5a96a6bc4cd788b8cb3e8d463a2a647d7f041 Performance warning if runtime debug assertions are turned on diff -r 03a5a96a6bc4 -r 6a768d3b4c61 IndexPlugin/Plugin.cpp --- a/IndexPlugin/Plugin.cpp Wed Jul 20 13:02:14 2016 +0200 +++ b/IndexPlugin/Plugin.cpp Wed Sep 07 09:17:25 2016 +0200 @@ -29,11 +29,21 @@ static OrthancPlugins::PostgreSQLWrapper* backend_ = NULL; +static bool DisplayPerformanceWarning() +{ + (void) DisplayPerformanceWarning; // Disable warning about unused function + OrthancPluginLogWarning(context_, "Performance warning in PostgreSQL index: " + "Non-release build, runtime debug assertions are turned on"); + return true; +} + + extern "C" { ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context) { context_ = context; + assert(DisplayPerformanceWarning()); /* Check the version of the Orthanc core */ if (OrthancPluginCheckVersion(context_) == 0) diff -r 03a5a96a6bc4 -r 6a768d3b4c61 NEWS --- a/NEWS Wed Jul 20 13:02:14 2016 +0200 +++ b/NEWS Wed Sep 07 09:17:25 2016 +0200 @@ -1,6 +1,8 @@ Pending changes in the mainline =============================== +* Performance warning if runtime debug assertions are turned on + Release 2.0 (2015/12/02) ======================== diff -r 03a5a96a6bc4 -r 6a768d3b4c61 StoragePlugin/Plugin.cpp --- a/StoragePlugin/Plugin.cpp Wed Jul 20 13:02:14 2016 +0200 +++ b/StoragePlugin/Plugin.cpp Wed Sep 07 09:17:25 2016 +0200 @@ -94,12 +94,21 @@ } +static bool DisplayPerformanceWarning() +{ + (void) DisplayPerformanceWarning; // Disable warning about unused function + OrthancPluginLogWarning(context_, "Performance warning in PostgreSQL storage: " + "Non-release build, runtime debug assertions are turned on"); + return true; +} + extern "C" { ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context) { context_ = context; + assert(DisplayPerformanceWarning()); /* Check the version of the Orthanc core */ if (OrthancPluginCheckVersion(context_) == 0)