A large chunk of this file was dealing with the caching of unwind plans.
In this patch I create a helper class to encapsulate this behavior and
leave the functions to deal with the actual work, which is to compute
the actual plan.
Since the caching now is handled by a separate class, it is also
possible to optimize it better without hampering readability. The way I
achieve that is by using a special shared_ptr value to mean "not
initialized" which means we can avoid having a special bool flag for
that purpose. This results in a net decrease of the size of the
FuncUnwinders object.
maybe use:
Then just check if it has no value, and if so compute and set it either to a valid shared pointer or an empty one?