forked from PoliEcho-holding-org/kern
maybe fix colors in kmalloc
This commit is contained in:
@@ -55,15 +55,15 @@ void* kmalloc(size_t size) {
|
||||
size_t alloc_index;
|
||||
{
|
||||
uint8_t leading_zeros = __builtin_clzll(size);
|
||||
if (__builtin_popcountll(size) == 1) {
|
||||
if (/*__builtin_popcountll(size) == */1) {
|
||||
alloc_index = leading_zeros;
|
||||
} else {
|
||||
alloc_index = sizeof(size) * CHAR_BIT - leading_zeros;
|
||||
}
|
||||
if (alloc_index > KMALLOC_MAX_SIZE) {
|
||||
// NOT IMPLEMENTED
|
||||
printk("Cannot allocate [%lu] bytes: \e[1MNOT "
|
||||
"IMPLEMENTED!\e[8M\n",
|
||||
printk("Cannot allocate [%lu] bytes: \e[1mNOT "
|
||||
"IMPLEMENTED!\e[0m\n",
|
||||
size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user