change deallocate_*() functions to void