1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-08 03:27:04 +09:00

GCAllocationTick ETW event

This commit is contained in:
vsadov 2022-12-18 15:36:44 -08:00
parent aaec9ea378
commit 7bb82b72d2

View file

@ -27,8 +27,9 @@
#include "common.h"
#include "gcenv.h"
#include "../env/gcenv.os.h"
#include "SatoriUtil.h"
#include "../gceventstatus.h"
#include "SatoriUtil.h"
#include "SatoriHeap.h"
#include "SatoriObject.h"
#include "SatoriObject.inl"
@ -228,6 +229,14 @@ SatoriObject* SatoriAllocator::AllocRegular(SatoriAllocationContext* context, si
context->alloc_ptr += size;
result->CleanSyncBlock();
region->SetIndicesForObject(result, result->Start() + size);
FIRE_EVENT(GCAllocationTick_V4,
size,
/*gen_number*/ 1,
/*heap_number*/ 0,
(void*)result,
0);
return result;
}
else
@ -386,6 +395,13 @@ SatoriObject* SatoriAllocator::AllocLarge(SatoriAllocationContext* context, size
result->CleanSyncBlock();
context->alloc_bytes_uoh += size;
region->SetIndicesForObject(result, result->Start() + size);
FIRE_EVENT(GCAllocationTick_V4,
size,
/*gen_number*/ 1,
/*heap_number*/ 0,
(void*)result,
0);
}
else
{
@ -480,6 +496,14 @@ SatoriObject* SatoriAllocator::AllocHuge(SatoriAllocationContext* context, size_
// but this one is not parseable yet since the new object has no MethodTable
// we will keep the region in gen -1 for now and make it gen1 or gen2 in PublishObject.
hugeRegion->StopAllocating(/* allocPtr */ 0);
FIRE_EVENT(GCAllocationTick_V4,
size,
/*gen_number*/ 2,
/*heap_number*/ 0,
(void*)result,
0);
return result;
}