Implemented TracingHeap_GetDataColor

This commit is contained in:
VegOwOtenks 2024-10-18 17:20:33 +02:00
parent 840b19adf2
commit 7120f59951
2 changed files with 9 additions and 0 deletions

View file

@ -131,6 +131,14 @@ int TracingHeap_AddTracingRoot(TracingHeap* self, void* data)
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
enum TracingColor TracingHeap_GetDataColor(TracingHeap* self, void* data)
{
(void) self;
TracingObject* root_object = _TracingObject_FromDataPointer(data);
return root_object->color;
}
int TracingHeap_TraceNext(TracingHeap* self) int TracingHeap_TraceNext(TracingHeap* self)
{ {
if (self == NULL) { if (self == NULL) {

View file

@ -61,5 +61,6 @@ int TracingHeap_EndTrace(TracingHeap* self);
int TracingHeap_TraceNext(TracingHeap* self); int TracingHeap_TraceNext(TracingHeap* self);
size_t TracingHeap_TraceNextN(TracingHeap* self, size_t n, int* error_code); size_t TracingHeap_TraceNextN(TracingHeap* self, size_t n, int* error_code);
int TracingHeap_AddTracingRoot(TracingHeap* self, void* data); int TracingHeap_AddTracingRoot(TracingHeap* self, void* data);
enum TracingColor TracingHeap_GetDataColor(TracingHeap* self, void* data);
#endif // header #endif // header