// file: tr_mm_grow_0.cc
//
 
// isip include files
//
#include "train_memory_manager.h"
#include "train_memory_manager_constants.h"
 
// method: grow_node_cc
//
// arguments: none
//
// return: a logical_1 indicating success
//
// this method grows the number of empty nodes by the node grow size
//
logical_1 Train_Memory_manager::grow_node_cc() {


  // insert the nodes in a list
  //
  for (int_4 i = 0; i < node_grow_size_d; i++) {
    // create new empty nodes
    //
    Train_Link_node* nodes = new Train_Link_node;
    
    if ((i == (int_4)0) && (node_count_d == (int_4)0)) {
      node_list_d = nodes;
    }
    else {
      node_list_d->insert_cc(nodes);
    }
    nodes++;
  }

  // update the count of free nodes
  //
  node_count_d += node_grow_size_d;

  // exit gracefully
  //
  return ISIP_TRUE;
}
