1 /***********************************************************************
3 * This software is part of the ast package *
4 * Copyright (c) 1985-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
13 * Information and Software Systems Research *
17 * Glenn Fowler <gsf@research.att.com> *
18 * David Korn <dgk@research.att.com> *
19 * Phong Vo <kpv@research.att.com> *
21 ***********************************************************************/
25 * install error message handler for fatal malloc exceptions
32 #include "FEATURE/vmalloc"
44 * print message and fail on VM_BADADDR,VM_NOMEM
48 nomalloc(Vmalloc_t
* region
, int type
, void* obj
, Vmdisc_t
* disc
)
56 error(ERROR_SYSTEM
|3, "invalid pointer %p passed to free or realloc", obj
);
60 error(ERROR_SYSTEM
|3, "storage allocator out of space on %lu byte request ( region %lu segments %lu busy %lu:%lu:%lu free %lu:%lu:%lu )", (size_t)obj
, st
.extent
, st
.n_seg
, st
.n_busy
, st
.s_busy
, st
.m_busy
, st
.n_free
, st
.s_free
, st
.m_free
);
67 * initialize the malloc exception handler
76 if (disc
= vmdisc(Vmregion
, NiL
))
77 disc
->exceptf
= nomalloc
;