anchor.diff: -%  Copyright 2008 Konrad-Zuse-Zentrum fr Informationstechnik Berlin
  +%  Copyright 2008, 2009 Konrad-Zuse-Zentrum fr Informationstechnik Berlin
   %
   %   Licensed under the Apache License, Version 2.0 (the "License");
   %   you may not use this file except in compliance with the License.
  
positive.code:             end,
      Nodes.
  
  %%===============================================================================
  %% Debug functions
  %%===============================================================================
  
  -spec(print_ages/0 :: () -> ok).
  print_ages() ->
  
negative.code:     {0, 0};
  get_aggregate(Tag, [{Dump, _} | Rest]) ->
      case gb_trees:lookup(Tag, Dump) of
          none ->
              get_aggregate(Tag, Rest);
          {value, {Size, Count}} ->
              {AggSize, AggCount} = get_aggregate(Tag, Rest),
              {AggSize + Size, AggCount + Count}
      end.
  
  diff_dump(BeforeDump, AfterDump, _RunTime) ->
      Tags = lists:usort(lists:flatten([gb_trees:keys(BeforeDump),
                                        gb_trees:keys(AfterDump)])),
      diff(Tags, BeforeDump, AfterDump).
  
  diff([], _Before, _After) ->
      [];
  diff([Tag | Rest], Before, After) ->
      {NewSize, NewCount} = gb_trees:get(Tag, After),
      case gb_trees:lookup(Tag, Before) of
          none ->
              [{Tag, NewSize, NewCount} | diff(Rest, Before, After)];
          {value, {Size, Count}} ->
              [{Tag, NewSize - Size, NewCount - Count} | diff(Rest, Before, After)]
      end.
  
  %%=============================================================================
  %% admin server functions
  %%=============================================================================
  start_link() ->
      {ok, spawn_link(?MODULE, start, [])}.
  
  