mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:58:11 +00:00
Run without SimpleMalloc locally for now.
This commit is contained in:
parent
0dac2c2b7f
commit
a181a8f6e7
3 changed files with 35 additions and 0 deletions
1
AK/.gitignore
vendored
1
AK/.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
akit-test
|
akit-test
|
||||||
|
*.o
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "Assertions.h"
|
#include "Assertions.h"
|
||||||
#include "OwnPtr.h"
|
#include "OwnPtr.h"
|
||||||
|
#include "kmalloc.h"
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
@ -1,6 +1,37 @@
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include "SimpleMalloc.h"
|
#include "SimpleMalloc.h"
|
||||||
#include <new>
|
#include <new>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#define USE_SYSTEM_MALLOC
|
||||||
|
|
||||||
|
#ifdef USE_SYSTEM_MALLOC
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
void* kcalloc(dword nmemb, dword size)
|
||||||
|
{
|
||||||
|
return calloc(nmemb, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* kmalloc(dword size)
|
||||||
|
{
|
||||||
|
return malloc(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void kfree(void* ptr)
|
||||||
|
{
|
||||||
|
free(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* krealloc(void* ptr, dword size)
|
||||||
|
{
|
||||||
|
return realloc(ptr, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
@ -64,3 +95,5 @@ void operator delete[](void* ptr, size_t)
|
||||||
return kfree(ptr);
|
return kfree(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue