Add trivial new[] and delete[] operators (Justin R. Cutler)
Fixes #73 Fixes #883
This commit is contained in:
parent
025ec2bc84
commit
09b755fb9c
|
@ -5,10 +5,20 @@ void * operator new(size_t size)
|
|||
return malloc(size);
|
||||
}
|
||||
|
||||
void * operator new[](size_t size)
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void operator delete(void * ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
void operator delete[](void * ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
int __cxa_guard_acquire(__guard *g) {return !*(char *)(g);};
|
||||
void __cxa_guard_release (__guard *g) {*(char *)g = 1;};
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
void * operator new(size_t size);
|
||||
void operator delete(void * ptr);
|
||||
void * operator new[](size_t size);
|
||||
void operator delete(void * ptr);
|
||||
void operator delete[](void * ptr);
|
||||
|
||||
__extension__ typedef int __guard __attribute__((mode (__DI__)));
|
||||
|
||||
|
|
Loading…
Reference in New Issue