about summary refs log blame commit diff stats
path: root/kernel.soso/alloc.h
blob: e4985aa59e3ad918a6cb637331a9dde6227d8d87 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                             
                     






                                         
#ifndef ALLOC_H
#define ALLOC_H

#include "common.h"
#include "process.h"

void initializeKernelHeap();
void *ksbrkPage(int n);
void *kmalloc(uint32 size);
void kfree(void *v_addr);

void initializeProcessHeap(Process* process);
void *sbrk(Process* process, int nBytes);

uint32 getKernelHeapUsed();

struct MallocHeader {
    unsigned long size:31;
    unsigned long used:1;
} __attribute__ ((packed));

typedef struct MallocHeader MallocHeader;

#endif // ALLOC_H