Skip to content

Simple library providing dynamic memory allocation for hobby OSes and embedded systems

License

Notifications You must be signed in to change notification settings

bigorenski/libmalloc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

libmalloc

Simple library providing dynamic memory allocation (similar to malloc) for hobby OSes and embedded systems

This library dependes on:
void* mmGetPages(MWORD n) - Returns a pointer to n contiguous pages (4kb each) - This should implement some kind of lock/unlock
void mmReleasePages(MWORD* address, MWORD n) - returns nothing. Release pages to the system - This should implement some kind of lock/unlock

<stdint.h> - Definitions for uint32_t and uint64_t(for x86_64 only)
<stdbool.h> - Definition for bool type
<string.h> - memcpy and memset

---------------------------------------------------------------------------------------------

This library provides:
MWORD - Macro. Extends to uint32_t or uint64_t depending on target
MWORD lmInit() - Initialize the library. Returns 0 on success
void* lmMalloc(MWORD size) - Similar to malloc. Returns pointer to allocated space
MWORD lmFree(void *ptr) - Returns how much data was freed

About

Simple library providing dynamic memory allocation for hobby OSes and embedded systems

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages