コード例 #1
0
ファイル: environment.cpp プロジェクト: ObiVaNN/libjpeg
/// Environ::~Environ
Environ::~Environ(void)
{
  // Check whether this is a child environment. If so,
  // check whether it accumulated any warnings. If it did,
  // forward its warning now into the warning of the parent.
  // This is thread-safe because the threads are only allocated
  // and released within the master/supervisor thread.
  if (m_pParent) {
    // This CPU becomes now available again.
    if (m_WarnRoot.m_Exception.ErrorOf()) {
      m_pParent->m_WarnRoot.m_Exception = m_WarnRoot.m_Exception;
    }
    //
    // Merge the warnings.
    m_pParent->MergeWarningQueueFrom(this);
  }
  //
  // Check if this was a copy that was made for a side-thread.
  if (m_Root.m_pActive && m_pParent == NULL) {
    //
    //
#ifdef HIST
    PrintHist();
#endif
    //
    //
#if CHECK_LEVEL > 0
    // Check only on the final destruction.
    printf("\n%ld bytes memory not yet released.\n"
	   "\n%ld bytes maximal required.\n"
	   "\n%ld allocations performed.\n",
	   long(totalmem),long(maxmem),long(malloccount));
# ifndef USE_VALGRIND
    // All memory released?
#  if defined(HAVE_ATOMIC_ADDSUB) || defined(USE_I386_XADD) || defined(USE_INTERLOCKED)
    assert(totalmem == 0);
#  else
    printf("\nFinal memory check skipped,\n"
	   "unreliable due to missing locking primitive\n");
#  endif
# endif
#endif
  }
}
コード例 #2
0
ファイル: Action_Density.cpp プロジェクト: Amber-MD/cpptraj
// Action_Density::Print()
void Action_Density::Print() {
  if (density_ == 0)
    PrintHist();
  else
    PrintDensity();
}