| 291 | } |
| 292 | |
| 293 | bf::System::Object* Internal::Dbg_ObjectAlloc(bf::System::Reflection::TypeInstance* typeInst, intptr size) |
| 294 | { |
| 295 | BF_ASSERT((BFRTFLAGS & BfRtFlags_ObjectHasDebugFlags) != 0); |
| 296 | Object* result; |
| 297 | |
| 298 | intptr allocSize = size; |
| 299 | |
| 300 | uint8* allocBytes = (uint8*)BfObjectAllocate(allocSize, typeInst->_GetType()); |
| 301 | result = (bf::System::Object*)allocBytes; |
| 302 | auto classVData = typeInst->mTypeClassVData; |
| 303 | (void)classVData; |
| 304 | |
| 305 | #ifndef BFRT_NODBGFLAGS |
| 306 | intptr dbgAllocInfo = (intptr)BF_RETURN_ADDRESS; |
| 307 | result->mClassVData = (intptr)classVData | (intptr)BfObjectFlag_Allocated /*| BFGC::sAllocFlags*/; |
| 308 | BF_FULL_MEMORY_FENCE(); // Since we depend on mDbAllocInfo to determine if we are allocated, we need to set this last after we're set up |
| 309 | result->mDbgAllocInfo = dbgAllocInfo; |
| 310 | BF_FULL_MEMORY_FENCE(); |
| 311 | result->mClassVData = (result->mClassVData & ~BF_OBJECTFLAG_MARK_ID_MASK) | BFGC::sAllocFlags; |
| 312 | #endif |
| 313 | return result; |
| 314 | } |
| 315 | |
| 316 | //#define DBG_OBJECTEND |
| 317 |
nothing calls this directly
no test coverage detected