mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
some code cleanups
This commit is contained in:
parent
e7b22d6187
commit
9416b9754c
1 changed files with 2 additions and 3 deletions
|
@ -219,14 +219,13 @@ ssize_t sys_sbrk(ssize_t incr)
|
|||
vma_t* heap = per_core(current_task)->heap;
|
||||
static spinlock_t heap_lock = SPINLOCK_INIT;
|
||||
|
||||
spinlock_lock(&heap_lock);
|
||||
|
||||
if (BUILTIN_EXPECT(!heap, 0)) {
|
||||
spinlock_unlock(&heap_lock);
|
||||
kprintf("sys_sbrk: missing heap!\n");
|
||||
do_abort();
|
||||
}
|
||||
|
||||
spinlock_lock(&heap_lock);
|
||||
|
||||
ret = heap->end;
|
||||
heap->end += incr;
|
||||
if (heap->end < heap->start)
|
||||
|
|
Loading…
Add table
Reference in a new issue