When we do the evaluation of a complicated operation, e.g. a transcendental function, we tend to perform a large number of temporary operations that create throw-away objects.
Add a cleanup class that takes care of saving the current temporary pointer, and if there was no garbage collection in the meantime, moves the resulting object at that location, essentially clearing all the intermediate objects.
When we do the evaluation of a complicated operation, e.g. a transcendental function, we tend to perform a large number of temporary operations that create throw-away objects.
Add a
cleanup
class that takes care of saving the current temporary pointer, and if there was no garbage collection in the meantime, moves the resulting object at that location, essentially clearing all the intermediate objects.