If someone needs Function to be refcounted, Function can be explicitly
wrapped in sharedpointer, like this:
var functionPtr = new(Function((x: Int) -> x * 2));
var thirtyFour = functionPtr^(17);
Note that sharedpointers are not thread-safe (thus Function weren't
thread-safe until this patch), so simple function copying could
cause memory problems.
If someone needs Function to be refcounted, Function can be explicitly wrapped in sharedpointer, like this:
Note that sharedpointers are not thread-safe (thus Function weren't thread-safe until this patch), so simple function copying could cause memory problems.