equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2019, 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. |
33 friend class ZLiveMapTest; |
33 friend class ZLiveMapTest; |
34 |
34 |
35 private: |
35 private: |
36 static const size_t nsegments = 64; |
36 static const size_t nsegments = 64; |
37 |
37 |
38 volatile uint32_t _seqnum; // Mark sequence number |
38 volatile uint32_t _seqnum; |
39 volatile uint32_t _live_objects; // Number of live objects |
39 volatile uint32_t _live_objects; |
40 volatile size_t _live_bytes; // Number of live bytes |
40 volatile size_t _live_bytes; |
41 BitMap::bm_word_t _segment_live_bits; // Segment live bits |
41 BitMap::bm_word_t _segment_live_bits; |
42 BitMap::bm_word_t _segment_claim_bits; // Segment claim bits |
42 BitMap::bm_word_t _segment_claim_bits; |
43 ZBitMap _bitmap; // Mark bitmap |
43 ZBitMap _bitmap; |
44 const size_t _shift; // Segment shift |
44 size_t _segment_shift; |
45 |
45 |
46 const BitMapView segment_live_bits() const; |
46 const BitMapView segment_live_bits() const; |
47 const BitMapView segment_claim_bits() const; |
47 const BitMapView segment_claim_bits() const; |
48 |
48 |
49 BitMapView segment_live_bits(); |
49 BitMapView segment_live_bits(); |
70 |
70 |
71 public: |
71 public: |
72 ZLiveMap(uint32_t size); |
72 ZLiveMap(uint32_t size); |
73 |
73 |
74 void reset(); |
74 void reset(); |
|
75 void resize(uint32_t size); |
75 |
76 |
76 bool is_marked() const; |
77 bool is_marked() const; |
77 |
78 |
78 uint32_t live_objects() const; |
79 uint32_t live_objects() const; |
79 size_t live_bytes() const; |
80 size_t live_bytes() const; |