Changeset f103fb in git for omalloc/omtTest.c


Ignore:
Timestamp:
Oct 4, 2000, 3:12:32 PM (24 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
400633927935ad03438bf37f1f7967d1b891903d
Parents:
ff4e34fa88e2957ee964d2e38c9e058cf143c963
Message:
* omGetStickyBinOfBin added


git-svn-id: file:///usr/local/Singular/svn/trunk@4638 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • omalloc/omtTest.c

    rff4e34f rf103fb  
    274274}
    275275
     276omBin omtGetStickyBin(omBin bin)
     277{
     278  omBin sticky_bin = omFindInGList(om_StickyBins, next, max_blocks, bin->max_blocks);
     279  if (sticky_bin == NULL)
     280    sticky_bin = omGetStickyBinOfBin(bin);
     281  return sticky_bin;
     282}
     283
     284void omtMergeStickyBins(omMemCell cell, int n)
     285{
     286  int i;
     287  omBin bin;
     288 
     289  for (i=0; i<n; i++)
     290  {
     291    if (cell[i].orig_bin != NULL)
     292    {
     293      if (omIsOnGList(om_StickyBins, next, cell[i].bin))
     294        omMergeStickyBinIntoBin(cell[i].bin, cell[i].orig_bin);
     295
     296      cell[i].bin = cell[i].orig_bin;
     297      cell[i].orig_bin = NULL;
     298    }
     299  }
     300 
     301  bin = om_StickyBins;
     302  while (bin != NULL)
     303  {
     304    if (bin->current_page == om_ZeroPage)
     305    {
     306      omBin next_bin = bin->next;
     307      om_StickyBins = omRemoveFromGList(om_StickyBins, next, bin);
     308      __omFreeBinAddr(bin);
     309      bin = next_bin;
     310    }
     311    else
     312    {
     313      bin = bin->next;
     314    }
     315  }
     316}
     317
     318 
    276319void my_exit()
    277320{
     
    351394      }
    352395#endif
     396      omtMergeStickyBins(cells, n_cells);
    353397      while (i< n_cells)
    354398      {
     
    357401      }
    358402      omFreeKeptAddr();
     403      omtMergeStickyBins(cells, -1);
    359404      omPrintStats(stdout);
    360405      omPrintInfo(stdout);
Note: See TracChangeset for help on using the changeset viewer.