/*ident "@(#)ctrans:lib/new/_new.c 1.2.2.2" */ /************************************************************************** Copyright (c) 1984 AT&T All Rights Reserved THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T The copyright notice above does not evidence any actual or intended publication of such source code. *****************************************************************************/ typedef void (*PFVV)(); extern PFVV _new_handler; extern "C" { extern char* calloc(unsigned, unsigned); } #include extern void* operator new(size_t size) { void* _last_allocation; while ( (_last_allocation=calloc(unsigned(size), 1))==0 ) { if(_new_handler) (*_new_handler)(); else return 0; } return _last_allocation; }