Ignore:
Timestamp:
Dec 15, 2003 11:03:31 AM (16 years ago)
Author:
forrest
Message:

Wssmp cholesky and stuff for gub

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpHelperFunctions.cpp

    r269 r275  
    111111  }
    112112}
     113#ifdef DEBUG_MEMORY
     114#include <malloc.h>
     115#include <stdio.h>
     116#include <stdlib.h>
    113117
     118typedef void (*NEW_HANDLER)();
     119static NEW_HANDLER new_handler;                        // function to call if `new' fails (cf. ARM p. 281)
     120
     121// Allocate storage.
     122void *
     123operator new(size_t size)
     124{
     125  void * p;
     126  for (;;)
     127    {
     128      p = malloc(size);
     129      if      (p)           break;        // success
     130      else if (new_handler) new_handler();   // failure - try again (allow user to release some storage first)
     131      else                  break;        // failure - no retry
     132    }
     133  if (size>1000000)
     134    printf("Allocating memory of size %d\n",size);
     135  return p;
     136}
     137
     138// Deallocate storage.
     139void
     140operator delete(void *p)
     141{
     142  free(p);
     143  return;
     144}
     145void
     146operator delete [] (void *p)
     147{
     148  free(p);
     149  return;
     150}
     151#endif
Note: See TracChangeset for help on using the changeset viewer.