Update to reflect current GC APIs and usage. The example code is taken from the Erlang GC implementation.