Loading [MathJax]/extensions/tex2jax.js
CS350 COS
COS
All Data Structures Files Functions Variables Typedefs Macros
malloc.c File Reference
#include <stdarg.h>
#include <stdint.h>
#include <kassert.h>
Include dependency graph for malloc.c:

Go to the source code of this file.

Data Structures

struct  TLSFBlock
 
struct  Heap
 

Typedefs

typedef struct TLSFBlock TLSFBlock
 
typedef struct Heap Heap
 

Functions

HeapMalloc_Create ()
 
void Malloc_Destroy (Heap *heap)
 
void * Malloc_Alloc (Heap *heap, uint64_t len)
 
void Malloc_Free (Heap *heap, void *buf)
 
bool Malloc_Realloc (Heap *heap, void *buf, uint64_t newlen)
 

Data Structure Documentation

◆ TLSFBlock

struct TLSFBlock

Definition at line 11 of file malloc.c.

Collaboration diagram for TLSFBlock:
[legend]
Data Fields
struct TLSFBlock * next
struct TLSFBlock * prev
struct TLSFBlock * prevBlock
uint64_t size

◆ Heap

struct Heap

Definition at line 20 of file malloc.c.

Collaboration diagram for Heap:
[legend]
Data Fields
struct TLSFBlock * blocks[SL_SIZE][FL_SIZE]
uint32_t flVector
uint64_t magic
uint64_t poolAllocs
uint64_t poolSize
uint32_t slVector[FL_SIZE]

Typedef Documentation

◆ Heap

typedef struct Heap Heap

◆ TLSFBlock

typedef struct TLSFBlock TLSFBlock

Function Documentation

◆ Malloc_Alloc()

void * Malloc_Alloc ( Heap heap,
uint64_t  len 
)

Definition at line 47 of file malloc.c.

48{
49}

◆ Malloc_Create()

Heap * Malloc_Create ( )

Definition at line 37 of file malloc.c.

38{
39}

◆ Malloc_Destroy()

void Malloc_Destroy ( Heap heap)

Definition at line 42 of file malloc.c.

43{
44}

◆ Malloc_Free()

void Malloc_Free ( Heap heap,
void *  buf 
)

Definition at line 52 of file malloc.c.

53{
54}

◆ Malloc_Realloc()

bool Malloc_Realloc ( Heap heap,
void *  buf,
uint64_t  newlen 
)

Definition at line 57 of file malloc.c.

58{
59}