hotspot/src/share/vm/utilities/workgroup.cpp
changeset 17376 4ee999c3c007
parent 17087 f0b76c4c93a0
child 24468 cb71997b6484
child 24424 2658d7834c6e
equal deleted inserted replaced
17374:a0b5154f6f6f 17376:4ee999c3c007
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   527 bool FreeIdSet::_safepoint;
   527 bool FreeIdSet::_safepoint;
   528 
   528 
   529 FreeIdSet::FreeIdSet(int sz, Monitor* mon) :
   529 FreeIdSet::FreeIdSet(int sz, Monitor* mon) :
   530   _sz(sz), _mon(mon), _hd(0), _waiters(0), _index(-1), _claimed(0)
   530   _sz(sz), _mon(mon), _hd(0), _waiters(0), _index(-1), _claimed(0)
   531 {
   531 {
   532   _ids = new int[sz];
   532   _ids = NEW_C_HEAP_ARRAY(int, sz, mtInternal);
   533   for (int i = 0; i < sz; i++) _ids[i] = i+1;
   533   for (int i = 0; i < sz; i++) _ids[i] = i+1;
   534   _ids[sz-1] = end_of_list; // end of list.
   534   _ids[sz-1] = end_of_list; // end of list.
   535   if (_stat_init) {
   535   if (_stat_init) {
   536     for (int j = 0; j < NSets; j++) _sets[j] = NULL;
   536     for (int j = 0; j < NSets; j++) _sets[j] = NULL;
   537     _stat_init = true;
   537     _stat_init = true;
   547   guarantee(_index != -1, "Too many FreeIdSets in use!");
   547   guarantee(_index != -1, "Too many FreeIdSets in use!");
   548 }
   548 }
   549 
   549 
   550 FreeIdSet::~FreeIdSet() {
   550 FreeIdSet::~FreeIdSet() {
   551   _sets[_index] = NULL;
   551   _sets[_index] = NULL;
       
   552   FREE_C_HEAP_ARRAY(int, _ids, mtInternal);
   552 }
   553 }
   553 
   554 
   554 void FreeIdSet::set_safepoint(bool b) {
   555 void FreeIdSet::set_safepoint(bool b) {
   555   _safepoint = b;
   556   _safepoint = b;
   556   if (b) {
   557   if (b) {