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

#include <instance.h>

// method: delete_cc
//
// arguments:
//  Instance* inst : (input) the instance to be put back in the list
//
// return: a logical_1 indicating success
//
// this method takes the input instance and puts it in the free
// instances list
//
logical_1 Memory_manager::delete_cc(Instance* inst_a) {

  // get a link node to hold this instance
  //
  Link_node* node = new_node_cc();
  
  // put the instance in this
  //
  inst_a->clear_cc();
  node->set_item_cc((void_p)inst_a);
  
  // insert the incoming node in the node list
  //
  node->insert_cc(instance_list_d);
  instance_list_d = node;
  
  // increment free instance count
  //
  instance_count_d++;

  // exit gracefully
  //
  return ISIP_TRUE;
}
