anchor.diff:      ?MODULE ! {free, Ch},
       ok.
   
  -%% can't use 2-tuple for state here as we do in sys_sp1, since the 2-tuple
  -%% is not compatible with the backward compatibility handling for
  -%% sys:get_state in sys.erl
  --record(state, {alloc,free}).
  -
   init([Parent,NumCh]) ->
       register(?MODULE, self()),
       Chs = channels(NumCh),
  
positive.code: %%
  %% %CopyrightBegin%
  %%
  %% Copyright Ericsson AB 1996-2013. All Rights Reserved.
  %%
  %% The contents of this file are subject to the Erlang Public License,
  %% Version 1.1, (the "License"); you may not use this file except in
  
negative.code:     io:format(Dev, "~p event = ~p~n", [Name, Event]).
  
  channels(NumCh) ->
      {_Allocated=[], _Free=lists:seq(1,NumCh)}.
  
  alloc({_, []}) ->
      {error, "no channels available"};
  alloc({Allocated, [H|T]}) ->
      {H, {[H|Allocated], T}}.
  
  free(Ch, {Alloc, Free}=Channels) ->
      case lists:member(Ch, Alloc) of
          true ->
              {lists:delete(Ch, Alloc), [Ch|Free]};
          false ->
              Channels
      end.
  