// file: mm_delete_1.cc
//
 
// isip include files
//
#include "memory_manager.h"
#include "memory_manager_constants.h"

#include <trace.h>

// method: delete_trace_cc
//
// arguments:
//   Trace* trace : (input) trace to be put back in memory
//
// return: a logical_1 indicating success
//
// this method takes the incoming trace and puts it in the list of
// available traces
//
logical_1 Memory_manager::delete_cc(Trace* trace_a) {

  // get a link node to hold this trace
  //
  Link_node* node = new_node_cc();

  // put this trace in the free traces list
  //
  trace_a->clear_cc();
  node->set_item_cc((void_p)trace_a);

  // insert the incoming node in the trace list
  //
  node->insert_cc(trace_list_d);
  trace_list_d = node;
  
  // increment free trace count
  //
  trace_count_d++;
  
  // exit gracefully
  //
  return ISIP_TRUE;
}
