libc/mem.c
u32 kmalloc(u32 size, int align, u32 * phys_addr) {
	/* Pages are aligned to 4K, or 0x1000 */
	if (align == 1 && (free_mem_addr & 0xFFFFF000)) {
		free_mem_addr &= 0xFFFFF000;
		free_mem_addr += 0x1000;
	}
	
	if (phys_addr)* phys_addr = free_mem_addr;

	u32 ret = free_mem_addr;
	free_mem_addr += size; 
	return ret;
}
/* Implementation is just a pointer to some free memory which
 * keeps growing */
Implementation is just a pointer to some free memory which
keeps growing
Implementation is just a pointer to some free memory which keeps growing
u32 kmalloc(u32 size, int align, u32 * phys_addr) {
	if (align == 1 && (free_mem_addr & 0xFFFFF000)) {
		free_mem_addr &= 0xFFFFF000;
		free_mem_addr += 0x1000;
	}
	if (phys_addr)* phys_addr = free_mem_addr;
	u32 ret = free_mem_addr;
	free_mem_addr += size; 
	return ret;
}
u32 kmalloc ( u32 size , int align , u32 * phys_addr ) { if ( align == 1 && ( free_mem_addr & 0xFFFFF000 ) ) { free_mem_addr &= 0xFFFFF000 ; free_mem_addr += 0x1000 ; } if ( phys_addr ) * phys_addr = free_mem_addr ; u32 ret = free_mem_addr ; free_mem_addr += size ; return ret ; }
Implementation is just a pointer to some free memory which
 keeps growing
Implementation is just a pointer to some free memory which keeps growing
/* Pages are aligned to 4K, or 0x1000 */