ART: Bitvector extensions for dumping and size handling
- Added dumping functions and the ensure size and clear function.
- Fixed a bug in union where if a bit is not set in the source, an buffer
overflow can occur later down.
Change-Id: Iff40529f3a8970a1ce2dd5c591f659f71924dea3
Signed-off-by: Jean Christophe Beyler <jean.christophe.beyler@intel.com>
Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
Signed-off-by: Yixin Shou <yixin.shou@intel.com>
Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
Signed-off-by: Udayan Banerji <udayan.banerji@intel.com>
diff --git a/runtime/base/bit_vector.h b/runtime/base/bit_vector.h
index a496dbd..db29c49 100644
--- a/runtime/base/bit_vector.h
+++ b/runtime/base/bit_vector.h
@@ -142,6 +142,14 @@
// Number of bits set in range [0, end) in storage. (No range check.)
static uint32_t NumSetBits(const uint32_t* storage, uint32_t end);
+ bool EnsureSizeAndClear(unsigned int num);
+
+ void Dump(std::ostream& os, const char* prefix);
+ void DumpDot(FILE* file, const char* prefix, bool last_entry = false);
+
+ protected:
+ void DumpHelper(std::ostringstream& buffer, const char* prefix);
+
private:
Allocator* const allocator_;
const bool expandable_; // expand bitmap if we run out?