plan9port/man/man3/venti-mem.3
Russ Cox 977b25a76a tmac: introduce real manual reference macro instead of overloading IR
The overloading of IR emits magic \X'...' sequences that turn into HTML manual links.
But not all such IR invocations should be manual links;
those had to be written to avoid the IR macro before.
Worse, the \X'...' ending the IR causes troff to emit only a single space after a period.

Defining a new IM macro for manual references fixes both problems.

Fixes #441.
2020-08-13 23:43:43 -04:00

66 lines
1,023 B
Groff

.TH VENTI-MEM 3
.SH NAME
vtbrk,
vtmalloc,
vtmallocz,
vtrealloc,
vtstrdup,
vtfree \- error-checking memory allocators
.SH SYNOPSIS
.ft L
#include <u.h>
.br
#include <libc.h>
.br
#include <venti.h>
.ta +\w'\fLvoid* 'u
.PP
.B
void* vtbrk(int size)
.PP
.B
void* vtmalloc(int size)
.PP
.B
void* vtmallocz(int size)
.PP
.B
void* vtrealloc(void *ptr, int size)
.PP
.B
char* vtstrdup(char *s)
.PP
.B
void vtfree(void *ptr)
.SH DESCRIPTION
These routines allocate and free memory.
On failure, they print an error message and call
.IM sysfatal (3) .
They do not return.
.PP
.I Vtbrk
returns a pointer to a new, permanently allocated block of at least
.I size
bytes.
.PP
.IR Vtmalloc ,
.IR vtrealloc ,
and
.I vtstrdup
are like
.IR malloc ,
.IR realloc ,
and
.IR strdup ,
but, as noted above, do not return on error.
.I Vtmallocz
is like
.I vtmalloc
but zeros the block before returning it.
Memory allocated with all four should be freed with
.I vtfree
when no longer needed.
.SH SOURCE
.B \*9/src/libventi
.SH SEE ALSO
.IM venti (3)