protected void setBufferManager( BufMgr mgrArg ) {
    
    mgr = mgrArg;
    int numBuffers = mgr.getNumBuffers();
    

    // These are the C++ code which we ignored
    //char *Sh_StateArr = MINIBASE_SHMEM->malloc((numBuffers * sizeof(STATE)));
    //state_bit = new(Sh_StateArr) STATE[numBuffers];


    for ( int index=0; index < numBuffers; ++index ) {
      state_bit[index].state = Available;
    }
    
    
    head = -1; // maintain the head of the clock.
  }