Skip to content
Snippets Groups Projects
Commit 78eb4ef5 authored by kwanju's avatar kwanju
Browse files

v2

parent e69479ca
No related branches found
No related tags found
No related merge requests found
#include "alloc.h"
#define MSIZE sizeof(meta_struct)-4
#include "alloc.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#define MSIZE sizeof(meta)-4
void* total = 0;
void* base = 0;
......@@ -7,8 +11,13 @@ void* end = 0;
void* cur = 0;
int fit;//0 1 2
void *m_malloc(size_t size);
void *m_realloc(void* ptr, size_t size);
void m_free(void* ptr);
meta* search(void* ptr, size_t size);
meta* search(void* ptr, size_t size){//current pointer
mata* index = base;
meta* index = base;
meta* result = 0;
if(base == ptr)
......
#ifndef _ALLOC_H_
#define _ALLOC_H_
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
typedef struct meta_struct {
typedef struct meta {
//double linked list
struct meta* prev;
struct meta* next;
......
#include "alloc.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
extern int fit;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment