mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 06:18:59 +00:00
Kernel: Remove some no-longer-needed C library functions
Now that we no longer demangle symbols in the kernel, we don't need to provide stuff like malloc(), memchr(), free(), etc to the demangler.
This commit is contained in:
parent
f684742f15
commit
0718bd264c
Notes:
sideshowbarker
2024-07-18 09:20:04 +09:00
Author: https://github.com/awesomekling
Commit: 0718bd264c
1 changed files with 0 additions and 26 deletions
|
@ -396,32 +396,6 @@ char* strstr(const char* haystack, const char* needle)
|
|||
return const_cast<char*>(haystack);
|
||||
}
|
||||
|
||||
void* memchr(const void* ptr, int c, size_t size)
|
||||
{
|
||||
char ch = c;
|
||||
auto* cptr = (const char*)ptr;
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
if (cptr[i] == ch)
|
||||
return const_cast<char*>(cptr + i);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* malloc(size_t s)
|
||||
{
|
||||
return kmalloc(s);
|
||||
}
|
||||
|
||||
void* realloc(void* p, size_t s)
|
||||
{
|
||||
return krealloc(p, s);
|
||||
}
|
||||
|
||||
void free(void* p)
|
||||
{
|
||||
return kfree(p);
|
||||
}
|
||||
|
||||
// Functions that are automatically called by the C++ compiler.
|
||||
// Declare them first, to tell the silly compiler that they are indeed being used.
|
||||
[[noreturn]] void __stack_chk_fail() __attribute__((used));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue