Browse Source

Calling convention fix (only triggered in Win32)

Brian Fiete 5 years ago
parent
commit
accc74957a
1 changed files with 6 additions and 3 deletions
  1. 6 3
      BeefRT/dbg/gc_raw.cpp

+ 6 - 3
BeefRT/dbg/gc_raw.cpp

@@ -127,7 +127,10 @@ void BFGC::RawMarkSpan(tcmalloc_raw::Span* span, int expectedStartPage)
 					extraDataSize += (1 + stackTraceCount) * sizeof(intptr);
 				}
 
-				typedef void(*MarkFunc)(void*);
+				struct MarkTarget
+				{
+				};
+				typedef void(MarkTarget::*MarkFunc)();
 				MarkFunc markFunc = *(MarkFunc*)&rawAllocData->mMarkFunc;
 				 
 				// It's possible we can overestimate elemCount, particularly for large allocations. This doesn't cause a problem
@@ -136,8 +139,8 @@ void BFGC::RawMarkSpan(tcmalloc_raw::Span* span, int expectedStartPage)
 				intptr dataSize = elementSize - extraDataSize;
 				intptr elemCount = dataSize / elemStride;
 				for (intptr elemIdx = 0; elemIdx < elemCount; elemIdx++)
-				{
-				 	markFunc((uint8*)spanPtr + elemIdx * elemStride);
+				{					
+					(((MarkTarget*)((uint8*)spanPtr + elemIdx * elemStride))->*markFunc)();
 				}
 			}
 		}