summaryrefslogtreecommitdiff
path: root/compiler/gc_map_builder.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-10-08 15:47:08 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-10-08 15:47:08 +0000
commit359f77c44dafef7ebed027180422ee75eef1467c (patch)
treeb4b7fd4f8bf646dcd106351aaf2f5c1e6d719911 /compiler/gc_map_builder.h
parent64d8d93aa9359b1126513dba92e27dbe184bfe3a (diff)
parentec7802a102d49ab5c17495118d4fe0bcc7287beb (diff)
Merge "Add DCHECKs to ArenaVector and ScopedArenaVector."
Diffstat (limited to 'compiler/gc_map_builder.h')
-rw-r--r--compiler/gc_map_builder.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/gc_map_builder.h b/compiler/gc_map_builder.h
index 45e3fc5589..2ef7f1a659 100644
--- a/compiler/gc_map_builder.h
+++ b/compiler/gc_map_builder.h
@@ -26,14 +26,16 @@ namespace art {
class GcMapBuilder {
public:
- template <typename Alloc>
- GcMapBuilder(std::vector<uint8_t, Alloc>* table, size_t entries, uint32_t max_native_offset,
+ template <typename Vector>
+ GcMapBuilder(Vector* table, size_t entries, uint32_t max_native_offset,
size_t references_width)
: entries_(entries), references_width_(entries != 0u ? references_width : 0u),
native_offset_width_(entries != 0 && max_native_offset != 0
? sizeof(max_native_offset) - CLZ(max_native_offset) / 8u
: 0u),
in_use_(entries) {
+ static_assert(std::is_same<typename Vector::value_type, uint8_t>::value, "Invalid value type");
+
// Resize table and set up header.
table->resize((EntryWidth() * entries) + sizeof(uint32_t));
table_ = table->data();