Skip to content

Instantly share code, notes, and snippets.

@erik
Created March 9, 2011 02:25
Show Gist options
  • Save erik/861571 to your computer and use it in GitHub Desktop.
Save erik/861571 to your computer and use it in GitHub Desktop.
diff --git a/src/metodo/i386/hal/mm/memory.c b/src/metodo/i386/hal/mm/memory.c
index 714143a..1315126 100644
--- a/src/metodo/i386/hal/mm/memory.c
+++ b/src/metodo/i386/hal/mm/memory.c
@@ -13,7 +13,7 @@ void *kmalloc_int(unsigned int size, unsigned int flags)
// Initialize if needed.
if (placement == 0)
- placement = end;
+ placement = (unsigned)&end;
// Align on a page if needed.
/* The following line was this, but meteger said to invert the bitmask in the check:
@@ -27,7 +27,7 @@ void *kmalloc_int(unsigned int size, unsigned int flags)
// Return the address of allocation and increment the next placement address to whatever.
tmp = placement;
placement += size;
- return (void*) placement;
+ return (void*) tmp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment