IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 30, 2006, 7:17:36 PM (20 years ago)
Author:
eugene
Message:

fixes..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/src/ohana_allocate.c

    r5344 r7782  
    3939} Memlist;
    4040
     41// XXX consider fixing the memory tracking model (list?)
     42// static long *memsort;
     43// static long *memhash;
    4144static Memlist *memlist = NULL;
    4245int Nmemlist = 0;
     
    4851  NMEMLIST = 1000;
    4952  OHANA_ALLOCATE (memlist, Memlist, NMEMLIST);
     53  // OHANA_ALLOCATE (memsort, long, NMEMLIST);
     54  // OHANA_ALLOCATE (memhash, long, NMEMLIST);
    5055  NMEMBYTE = sizeof(size_t);
    5156}
     
    8691  memlist[Nmemlist].size = size;
    8792  memlist[Nmemlist].state = STATE_ALLOC;
     93
     94  // before each free, we sort this pair to speed up searching
     95  // memsort[Nmemlist] = ptr;
     96  // memhash[Nmemlist] = Nmemlist;
     97
    8898  Nmemlist ++;
    8999  if (Nmemlist == NMEMLIST) {
     
    143153}
    144154
     155// this is very slow.  should we speed this up by indexing on the ptr?
    145156void ohana_free (char *file, int line, void *in) {
    146157
     
    199210
    200211  header = FALSE;
     212  fprintf (stderr, "checking %d memory blocks\n", Nmemlist);
    201213  for (i = 0; i < Nmemlist; i++) {
    202214    if (memlist[i].state == STATE_EXTERNAL) continue;
Note: See TracChangeset for help on using the changeset viewer.