Added an option to specify the names of heap freeing functions.