]> Chaos Git - corbenik/corbenik.git/commitdiff
Revert a few changes that caused a severe regression, causing inability to firmlaunch.
authorchaoskagami <chaos.kagami@gmail.com>
Fri, 14 Oct 2016 08:17:39 +0000 (04:17 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Fri, 14 Oct 2016 08:20:28 +0000 (04:20 -0400)
These commits are reverted (partially):
  "Fixup"
    da1a41cf95fc9aea198f621fc6fe2692870bb4f6
  "Improve some documentation based on in-progress RE, zero-fill new program break (remind me not to rely on this)"
    330cd376ccc71c89b0568ab3741ce56e2fa667f2

source/std/allocator.c

index 01f6bd79fad961ff875d101f80f1e3c5e75e5305..4b21ed90196f2e2743bfaeb1abc208c1f8a4f144 100644 (file)
@@ -8,21 +8,18 @@ static uint32_t *heap_end = NULL;
 extern uint32_t __end__; /* Defined by the linker */
 
 void* sbrk(size_t incr) {
-    uint32_t        *prev_heap_end;
+  uint32_t        *prev_heap_end;
 
-    if (heap_end == NULL) {
-        heap_end = &__end__;
-    }
-
-    // FIXME - Make sure heap isn't leaking into stack here. That would be bad.
-
-    prev_heap_end = heap_end;
+  if (heap_end == NULL) {
+    heap_end = &__end__;
+  }
 
-    heap_end += incr;
+  // FIXME - Make sure heap isn't leaking into stack here. That would be bad.
 
-    memset(prev_heap_end, 0, (uint32_t)heap_end - (uint32_t)prev_heap_end); // Clear heap.
+  prev_heap_end = heap_end;
 
-    return (void*) prev_heap_end;
+  heap_end += incr;
+  return (void*) prev_heap_end;
 }
 
 // This is an incredibly crappy and inefficient implementation of malloc/free nicked from stackoverflow.