63 void assert_proper_lock_protection() const { 64 #ifdef ASSERT 65 if (_protecting_lock != NULL) 66 assert_proper_lock_protection_work(); 67 #endif 68 } 69 70 void increment_count() { 71 _count++; 72 } 73 74 void decrement_count() { 75 _count--; 76 assert(_count >= 0, "Count should not be negative"); 77 } 78 79 public: 80 // Constructor 81 // Construct a list without any entries. 82 FreeList(); 83 // Construct a list with "fc" as the first (and lone) entry in the list. 84 FreeList(Chunk_t* fc); 85 86 // Do initialization 87 void initialize(); 88 89 // Reset the head, tail, and count of a free list. 90 void reset(); 91 92 // Declare the current free list to be protected by the given lock. 93 #ifdef ASSERT 94 Mutex* protecting_lock() const { return _protecting_lock; } 95 void set_protecting_lock(Mutex* v) { 96 _protecting_lock = v; 97 } 98 #endif 99 100 // Accessors. 101 Chunk_t* head() const { 102 assert_proper_lock_protection(); 103 return _head; 104 } | 63 void assert_proper_lock_protection() const { 64 #ifdef ASSERT 65 if (_protecting_lock != NULL) 66 assert_proper_lock_protection_work(); 67 #endif 68 } 69 70 void increment_count() { 71 _count++; 72 } 73 74 void decrement_count() { 75 _count--; 76 assert(_count >= 0, "Count should not be negative"); 77 } 78 79 public: 80 // Constructor 81 // Construct a list without any entries. 82 FreeList(); 83 84 // Do initialization 85 void initialize(); 86 87 // Reset the head, tail, and count of a free list. 88 void reset(); 89 90 // Declare the current free list to be protected by the given lock. 91 #ifdef ASSERT 92 Mutex* protecting_lock() const { return _protecting_lock; } 93 void set_protecting_lock(Mutex* v) { 94 _protecting_lock = v; 95 } 96 #endif 97 98 // Accessors. 99 Chunk_t* head() const { 100 assert_proper_lock_protection(); 101 return _head; 102 } |