add optimaization on case when extend_heap is called, the last block is free