#endif
+#if SIZEOF_VOID_P == 4
+#define InterlockedAddP(p,add) InterlockedAdd ((volatile gint32*)p, (gint32)add)
+#else
+#define InterlockedAddP(p,add) InterlockedAdd64 ((volatile gint64*)p, (gint64)add)
+#endif
+
#endif /* _WAPI_ATOMIC_H_ */
void
account_mem (MonoMemAccountType type, ssize_t size)
{
-#if SIZEOF_VOID_P == 4
- InterlockedAdd ((volatile gint32*)&allocation_count [type], (gint32)size);
- InterlockedAdd ((volatile gint32*)&total_allocation_count, (gint32)size);
-#else
- InterlockedAdd64 ((volatile gint64*)&allocation_count [type], (gint64)size);
- InterlockedAdd64 ((volatile gint64*)&total_allocation_count, (gint64)size);
-#endif
+ InterlockedAddP (&allocation_count [type], size);
+ InterlockedAddP (&total_allocation_count, size);
}
void