Implemented IsTraceFinished, removed global linked list

This commit is contained in:
vegowotenks 2024-10-16 17:23:37 +02:00
parent c6ff6ad31d
commit d3722aac83
2 changed files with 16 additions and 13 deletions

View file

@ -4,6 +4,7 @@
#include "../allocator-interface/allocator-interface.h"
#include <stdalign.h>
#include <stdbool.h>
enum TracingColor {
TRACINGCOLOR_BLACK,
@ -12,8 +13,6 @@ enum TracingColor {
};
typedef struct TracingObject {
struct TracingObject* global_next;
struct TracingObject* global_prev;
struct TracingObject* color_next;
struct TracingObject* color_prev;
enum TracingColor color;
@ -39,7 +38,6 @@ typedef struct TracingHeapConfig_s {
} TracingHeapConfig;
typedef struct TracingHeap_s {
TracingObject* objects;
TracingObject* white_objects;
TracingObject* grey_objects;
TracingObject* black_objects;
@ -57,6 +55,7 @@ void TracingHeap_Destroy(TracingHeap* self);
void* TracingHeap_Allocate(TracingHeap* self, size_t bytes);
int TracingHeap_BeginTrace(TracingHeap* self);
bool TracingHeap_IsTraceFinished(TracingHeap* self);
int TracingHeap_EndTrace(TracingHeap* self);
int TracingHeap_TraceNext(TracingHeap* self);
size_t TracingHeap_TraceNextN(TracingHeap* self, size_t n);