Fix 64bit compilation issues with IndirectRef.
For now the high 32bits are unused when pointers are 64bit.
Change-Id: I2154d9a5e70a122301e97739caf7fc1dc505795d
diff --git a/runtime/indirect_reference_table.h b/runtime/indirect_reference_table.h
index 51b238c..21e942e 100644
--- a/runtime/indirect_reference_table.h
+++ b/runtime/indirect_reference_table.h
@@ -326,7 +326,7 @@
* Extract the table index from an indirect reference.
*/
static uint32_t ExtractIndex(IndirectRef iref) {
- uint32_t uref = (uint32_t) iref;
+ uintptr_t uref = reinterpret_cast<uintptr_t>(iref);
return (uref >> 2) & 0xffff;
}
@@ -337,8 +337,8 @@
IndirectRef ToIndirectRef(const mirror::Object* /*o*/, uint32_t tableIndex) const {
DCHECK_LT(tableIndex, 65536U);
uint32_t serialChunk = slot_data_[tableIndex].serial;
- uint32_t uref = serialChunk << 20 | (tableIndex << 2) | kind_;
- return (IndirectRef) uref;
+ uintptr_t uref = serialChunk << 20 | (tableIndex << 2) | kind_;
+ return reinterpret_cast<IndirectRef>(uref);
}
/*