Marking Values as Permanent or Collectable (SDK)
You can also mark a value as permanent by calling the make_permanent() member function on it:
vl.foo->make_permanent();
From then on the value is in the root set and will be scanned for internal references but is not eligible for collection. This operation is fairly heavy-weight and so should not be used in place of value_local variables.
You can also make a permanent value collectable again by calling the member function make_collectable():
foo->make_collectable();