comparison hotspot/src/share/vm/gc/shared/workgroup.hpp @ 35040:d00805788fdd

8141123: Cleanup in FreeIdSet Summary: Some members of FreeIdSet should be size_t instead of ints. Also remove unused code Reviewed-by: tschatzl, kbarrett, tbenson
author aharlap
date Thu, 03 Dec 2015 15:37:52 -0500
parents 77bf0d2069a3
children 34ab60aee787
comparison
equal deleted inserted replaced
9:ade0e7ef48f9 10:04063a1b7322
377 // cleanup if necessary. 377 // cleanup if necessary.
378 bool all_tasks_completed(); 378 bool all_tasks_completed();
379 }; 379 };
380 380
381 // Represents a set of free small integer ids. 381 // Represents a set of free small integer ids.
382 class FreeIdSet : public CHeapObj<mtInternal> { 382 class FreeIdSet : public CHeapObj<mtGC> {
383 enum { 383 enum {
384 end_of_list = -1, 384 end_of_list = UINT_MAX,
385 claimed = -2 385 claimed = UINT_MAX - 1
386 }; 386 };
387 387
388 int _sz; 388 uint _size;
389 Monitor* _mon; 389 Monitor* _mon;
390 390
391 int* _ids; 391 uint* _ids;
392 int _hd; 392 uint _hd;
393 int _waiters; 393 uint _waiters;
394 int _claimed; 394 uint _claimed;
395 395
396 static bool _safepoint; 396 public:
397 typedef FreeIdSet* FreeIdSetPtr; 397 FreeIdSet(uint size, Monitor* mon);
398 static const int NSets = 10;
399 static FreeIdSetPtr _sets[NSets];
400 static bool _stat_init;
401 int _index;
402
403 public:
404 FreeIdSet(int sz, Monitor* mon);
405 ~FreeIdSet(); 398 ~FreeIdSet();
406 399
407 static void set_safepoint(bool b);
408
409 // Attempt to claim the given id permanently. Returns "true" iff
410 // successful.
411 bool claim_perm_id(int i);
412
413 // Returns an unclaimed parallel id (waiting for one to be released if 400 // Returns an unclaimed parallel id (waiting for one to be released if
414 // necessary). Returns "-1" if a GC wakes up a wait for an id. 401 // necessary).
415 int claim_par_id(); 402 uint claim_par_id();
416 403
417 void release_par_id(int id); 404 void release_par_id(uint id);
418 }; 405 };
419 406
420 #endif // SHARE_VM_GC_SHARED_WORKGROUP_HPP 407 #endif // SHARE_VM_GC_SHARED_WORKGROUP_HPP