result is almost OK, cut something more
+ merge_free_memory function ok?!
+ merge_free_memory function ok?!
+ merge_free_memory function ok?!
+ everything seems OK, bu I think allocated memory doesnot need sort