From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/memdbg/realloc.x | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sys/memdbg/realloc.x (limited to 'sys/memdbg/realloc.x') diff --git a/sys/memdbg/realloc.x b/sys/memdbg/realloc.x new file mode 100644 index 00000000..a3d1c866 --- /dev/null +++ b/sys/memdbg/realloc.x @@ -0,0 +1,25 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include + +# REALLOC -- Change the size of a previously allocated buffer, moving the +# buffer if necessary. If there is no old buffer (NULL pointer) simply +# allocate a new buffer. + +procedure realloc (ubufp, nelems, dtype) + +pointer ubufp # buffer to be reallocated +int nelems # new size of buffer +int dtype # buffer datatype + +int krealloc() +int zrtadr() +include "memdbg.com" + +begin + retaddr = zrtadr() + if (krealloc (ubufp, nelems, dtype) == ERR) { + ubufp = NULL + call syserr (SYS_MFULL) + } +end -- cgit