diff options
| author | 2015-02-19 19:03:44 +0000 | |
|---|---|---|
| committer | 2015-02-19 19:03:45 +0000 | |
| commit | 6aa7fe620a95b4404a4fed451e46ebf0cdd66204 (patch) | |
| tree | b4f9de3fc83fa377813e1d9bca01dcd97e285030 /runtime/utils.h | |
| parent | 04c1acf428d5a35948be06a6ae857abb7b32dc6f (diff) | |
| parent | 80b96d1a76790527f72a660ac03d9c215eed17ce (diff) | |
Merge "Replace a few std::vector with ArenaVector in Mir2Lir."
Diffstat (limited to 'runtime/utils.h')
| -rw-r--r-- | runtime/utils.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/utils.h b/runtime/utils.h index 0fbc9df5a7..3191e7d305 100644 --- a/runtime/utils.h +++ b/runtime/utils.h @@ -546,7 +546,13 @@ class VoidFunctor { } }; -void PushWord(std::vector<uint8_t>* buf, int32_t data); +template <typename Alloc> +void Push32(std::vector<uint8_t, Alloc>* buf, int32_t data) { + buf->push_back(data & 0xff); + buf->push_back((data >> 8) & 0xff); + buf->push_back((data >> 16) & 0xff); + buf->push_back((data >> 24) & 0xff); +} void EncodeUnsignedLeb128(uint32_t data, std::vector<uint8_t>* buf); void EncodeSignedLeb128(int32_t data, std::vector<uint8_t>* buf); |