From ec7802a102d49ab5c17495118d4fe0bcc7287beb Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 1 Oct 2015 20:57:57 +0100 Subject: Add DCHECKs to ArenaVector and ScopedArenaVector. Implement dchecked_vector<> template that DCHECK()s element access and insert()/emplace()/erase() positions. Change the ArenaVector<> and ScopedArenaVector<> aliases to use the new template instead of std::vector<>. Remove DCHECK()s that have now become unnecessary from the Optimizing compiler. Change-Id: Ib8506bd30d223f68f52bd4476c76d9991acacadc --- runtime/utils.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime/utils.h') diff --git a/runtime/utils.h b/runtime/utils.h index 3e618247d0..19cc462762 100644 --- a/runtime/utils.h +++ b/runtime/utils.h @@ -286,8 +286,9 @@ class VoidFunctor { } }; -template -void Push32(std::vector* buf, int32_t data) { +template +void Push32(Vector* buf, int32_t data) { + static_assert(std::is_same::value, "Invalid value type"); buf->push_back(data & 0xff); buf->push_back((data >> 8) & 0xff); buf->push_back((data >> 16) & 0xff); -- cgit v1.2.3-59-g8ed1b