aboutsummaryrefslogtreecommitdiff
path: root/sys/memdbg/realloc.x
blob: a3d1c8667f023bc8457ddcb626b19907ce246ddb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<syserr.h>

# 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