ALOGE("Unable to allocate monitor");
dvmAbort();
}
- if (((u4)mon & 7) != 0) {
- ALOGE("Misaligned monitor: %p", mon);
- dvmAbort();
- }
mon->obj = obj;
dvmInitMutex(&mon->lock);
#ifndef WITH_COPYING_GC
u4 dvmIdentityHashCode(Object *obj)
{
- return (u4)obj;
+ /*
+ * The following assumes that objects are allocated at even boundaries, so
+ * the shift preserves uniqueness of hashCode() while guaranteeing a
+ * non-negative result (for the convenience of some applications,like MiTalk).
+ */
+ return (u4)(((u4)obj)>>1);
}
#else
/*