facf0c92e0
Red Bear OS is a full fork. All sources must be available from git clone with zero network access. Removed gitignore rules that excluded fetched source trees under recipes/*/source/, local/recipes/kde/*/source/, local/recipes/qt/*/source/, and vendor source trees. Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded. 127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt frameworks, mesa, wayland, DRM drivers, and every other recipe source.
55 lines
664 B
C++
55 lines
664 B
C++
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <new>
|
|
#include "dl5.h"
|
|
|
|
int pass = 0;
|
|
|
|
void *
|
|
operator new (size_t sz, const std::nothrow_t&) throw ()
|
|
{
|
|
void *p;
|
|
pass++;
|
|
p = malloc(sz);
|
|
return p;
|
|
}
|
|
|
|
void *
|
|
operator new (size_t sz) throw (std::bad_alloc)
|
|
{
|
|
void *p;
|
|
pass++;
|
|
p = malloc(sz);
|
|
return p;
|
|
}
|
|
|
|
void
|
|
operator delete (void *ptr) throw ()
|
|
{
|
|
pass++;
|
|
if (ptr)
|
|
free (ptr);
|
|
}
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
A *bb = new A[10];
|
|
foo (bb);
|
|
delete [] bb;
|
|
bb = new (std::nothrow) A [10];
|
|
foo (bb);
|
|
delete [] bb;
|
|
|
|
if (pass == 4)
|
|
{
|
|
printf ("PASS\n");
|
|
return 0;
|
|
}
|
|
else
|
|
{
|
|
printf ("FAIL\n");
|
|
return 1;
|
|
}
|
|
}
|