Ejemplo n.º 1
0
static void stmtNewHandler()
{
  delete[] stmtNewHandler_CharSave;
  // There are some components are catching all exceptions, e.g.
  // optimizer is catching all exceptions including CMPABORT.
  // To avoid deleting the stmtNewHandler_CharSave more than once,
  // it is set to null after deletion.
  stmtNewHandler_CharSave=0;

  // Log this error to the file indicated by CMP_ERR_LOG_FILE CQD.
  CmpErrLog("Memory allocation failure");

  if ( CmpCommon::context() )
  {
    *(CmpCommon::diags() ) << DgSqlCode(arkcmpErrorOutOfMemory);
    CMPABORT;
  }
  else
  {
    // Must be in the ConnectionType request, the cmpContext is not setup yet;
    TODOEMSABORT("Run out of virtual memory");
    myNAExit(1);
  }
  //return 0;
}
Ejemplo n.º 2
0
static Int32  mainNewHandler(size_t s)

{
  if (mainNewHandler_CharSave)
  {
    delete[] mainNewHandler_CharSave;
    mainNewHandler_CharSave = NULL;
    CmpErrLog((char *)"Memory allocation failure");
    ArkcmpFatalError(ARKCMP_ERROR_PREFIX "Out of virtual memory.", NOMEM_SEV);
  }
  return 0;

}
Ejemplo n.º 3
0
// CmpErrLog::CmpErrLogCallback() is called by the NAMemory code when
// a memory allocation failure occurs. This function just logs the
// failure.
void CmpErrLog::CmpErrLogCallback(NAHeap *heap, size_t userSize)
{
  CmpErrLog("Memory allocation failure", heap, userSize);
}