Rev 590 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 590 | Rev 591 | ||
---|---|---|---|
Line 62... | Line 62... | ||
62 | void *early_malloc(size_t size) |
62 | void *early_malloc(size_t size) |
63 | { |
63 | { |
64 | ipl_t ipl; |
64 | ipl_t ipl; |
65 | chunk_t *x, *y, *z; |
65 | chunk_t *x, *y, *z; |
66 | 66 | ||
67 | size = ALIGN_UP(size, sizeof(__native)); |
- | |
68 | - | ||
69 | if (size == 0) |
67 | if (size == 0) |
70 | panic("zero-size allocation request"); |
68 | panic("zero-size allocation request"); |
71 | 69 | ||
- | 70 | size = ALIGN_UP(size, sizeof(__native)); |
|
- | 71 | ||
72 | x = chunk0; |
72 | x = chunk0; |
73 | ipl = interrupts_disable(); |
73 | ipl = interrupts_disable(); |
74 | spinlock_lock(&heaplock); |
74 | spinlock_lock(&heaplock); |
75 | while (x) { |
75 | while (x) { |
76 | if (x->used || x->size < size) { |
76 | if (x->used || x->size < size) { |