• Sergei Golubchik's avatar
    memroot improvement: fix savepoint support · be5b3f15
    Sergei Golubchik authored
    savepoint support was added a year ago as get_last_memroot_block()
    and free_all_new_blocks(), but it didn't work and was disabled.
    
    * fix it to work
    * instead of freeing the memory, only mark blocks free - this feature
      is supposed to be used inside a loop (otherwise there is no need
      to free anything, end of statement will do it anyway). And freeing
      blocks inside a loop is a bad idea, as they'll be all malloc-ed
      on the next iteration again. So, don't.
    * fix a bug in mark_blocks_free() - it doesn't change the number of blocks
    be5b3f15
my_alloc.h 2.17 KB