1 /************************************************************************
2 * IRC - Internet Relay Chat, ircd/ircd_alloc.c
3 * Copyright (C) 1999 Thomas Helvey (BleepSoft)
5 * See file AUTHORS in IRC package for additional names of
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 1, or (at your option)
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include "ircd_alloc.h"
27 #include "ircd_string.h"
33 static void nomem_handler(void);
35 /* Those ugly globals... */
36 OutOfMemoryHandler noMemHandler = nomem_handler;
45 Debug((DEBUG_FATAL, "Out of memory, exiting"));
51 set_nomem_handler(OutOfMemoryHandler handler)
53 noMemHandler = handler;
56 void* DoMalloc(size_t size, const char* x, const char* y, int z)
58 void* t = malloc(size);
64 void* DoMallocZero(size_t size, const char* x, const char* y, int z)
66 void* t = malloc(size);