blob: 5b42329528950e6f97f0be81e2b670cdfae77687 (
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
.help zraloc May84 "System Interface"
.ih
NAME
zraloc -- reallocate memory
.ih
SYNOPSIS
.nf
zraloc (buffer, nbytes, status)
int buffer # address of buffer
int nbytes # size of buffer
int status
.fi
.ih
DESCRIPTION
The size of the previously allocated buffer pointed to by \fIbuffer\fR is
changed to \fInbytes\fR. The buffer pointer must be the SPP char address
returned by a previous call to \fBzmaloc\fR or \fBzraloc\fR.
If necessary the buffer will be moved and the buffer pointer \fIbuffer\fR
modified to point to the new buffer. If the buffer is moved the contents of
the buffer are preserved.
.ih
RETURN VALUE
XERR is returned if the buffer pointer is invalid or if the buffer cannot be
reallocated. XOK is returned if the operation is successful.
.ih
NOTES
The integer \fIbuffer\fR is a memory address in SPP char units with an
arbitrary zero point, i.e., the type of address returned by \fBzlocva\fR.
The high level code converts the buffer address into an offset into \fBMem\fR,
i.e., into an SPP pointer.
.nf
char_pointer_into_Mem = buffer - zlocva(Memc) + 1
Memc[char_pointer] = first char of buffer
.fi
Since the buffer address is returned in char units the buffer must be aligned
to at least the size of a char; no greater degree of alignment is guaranteed
nor required. See the specifications of \fBzlocva\fR for additional information
about addresses and address arithmetic.
.ih
SEE ALSO
zmaloc, zmfree, zlocva
.endhelp
|