#include "chunk.h" void *raw_get_last_chunk(void **root) { void **current = root; if (current == NULL) return NULL; while (current[CHUNK_NEXT_POS] != NULL) current = current[CHUNK_NEXT_POS]; return current; } void *raw_get_chunk(void **root, void *data_start) { void**current = root; while (current != NULL) { if (current[CHUNK_DATA_START_POS] == data_start) return current; current = current[CHUNK_NEXT_POS]; } return NULL; }