feat: update structure

This commit is contained in:
2024-01-22 14:27:40 +08:00
parent 7836c9185c
commit 3544a28a2e
559 changed files with 120846 additions and 4102 deletions

View File

@@ -0,0 +1,25 @@
#include <stdio.h>
#include <stdlib.h>
#include "mymalloc.h"
char _heap[MEMSIZE] = {0};
TNode *_memlist = NULL; // To maintain information about length
// Do not change this. Used by the test harness.
// You may however use this function in your code if necessary.
long get_index(void *ptr) {
if(ptr == NULL)
return -1;
else
return (long) ((char *) ptr - &_heap[0]);
}
// Allocates size bytes of memory and returns a pointer
// to the first byte.
void *mymalloc(size_t size) {
}
// Frees memory pointer to by ptr.
void myfree(void *ptr) {
}