#include <stdlib.h>

typedef void (*PFVV)();

extern PFVV _new_handler;

static void link_rot() {
	extern PFVV set_new_handler(PFVV);
	set_new_handler(0);
}

void* operator new(size_t size)
{
	void *p;

	while(!(p = malloc(size))){
		if(_new_handler && size)
			(*_new_handler)();
		else
			return 0;
	}
	return p;
}
