summaryrefslogtreecommitdiff
path: root/static/v10/man3/malloc.3
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
commit97d5c458cfa039d857301e1ca7d5af3beb37131d (patch)
treeb460cd850d0537eb71806ba30358840377b27688 /static/v10/man3/malloc.3
parentb89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff)
build: Better Build System
Diffstat (limited to 'static/v10/man3/malloc.3')
-rw-r--r--static/v10/man3/malloc.394
1 files changed, 0 insertions, 94 deletions
diff --git a/static/v10/man3/malloc.3 b/static/v10/man3/malloc.3
deleted file mode 100644
index 2b241b30..00000000
--- a/static/v10/man3/malloc.3
+++ /dev/null
@@ -1,94 +0,0 @@
-.TH MALLOC 3
-.CT 2 mem_man
-.SH NAME
-malloc, free, realloc, calloc, cfree \- memory allocator
-.SH SYNOPSIS
-.nf
-.B char *malloc(size)
-.B unsigned size;
-.PP
-.B free(ptr)
-.B char *ptr;
-.PP
-.B char *realloc(ptr, size)
-.B char *ptr;
-.B unsigned size;
-.PP
-.B char *calloc(nelem, elsize)
-.B unsigned nelem, elsize;
-.PP
-.B cfree(ptr)
-.B char *ptr;
-.fi
-.SH DESCRIPTION
-.I Malloc
-and
-.I free
-provide a simple memory allocation package.
-.I Malloc
-returns a pointer to a new block of at least
-.I size
-bytes.
-The block is suitably aligned for storage of any type of object.
-No two active pointers from
-.I malloc
-will have the same value.
-.PP
-The argument to
-.I free
-is a pointer to a block previously allocated by
-.IR malloc ;
-this space is made available for further allocation.
-.PP
-.I Realloc
-changes the size of the block pointed to by
-.I ptr
-to
-.I size
-bytes and returns a pointer to the (possibly moved)
-block.
-The contents will be unchanged up to the
-lesser of the new and old sizes.
-The call
-.B "realloc((char*)0, size)
-means the same as
-.LR malloc(size) .
-.PP
-.I Calloc
-allocates space for
-an array of
-.I nelem
-elements of size
-.I elsize.
-The space is initialized to zeros.
-.I Cfree
-frees such a block.
-.SH SEE ALSO
-.IR galloc (3),
-.IR brk (2),
-.IR pool (3),
-.IR block (3)
-.SH DIAGNOSTICS
-.I Malloc, realloc
-and
-.I calloc
-return 0 if there is no available memory
-or if the arena has been detectably corrupted.
-.SH BUGS
-When
-.I realloc
-returns 0, the block pointed to by
-.I ptr
-may have been destroyed.
-.PP
-User errors can corrupt the storage arena.
-The most common gaffes are (1) freeing an already freed block,
-(2) storing beyond the bounds of an allocated block, and (3)
-freeing data that was not obtained from the allocator.
-To help find such errors, a diagnosing allocator
-may be loaded; use flag
-.B -ldmalloc
-of
-.IR cc (1).
-An even more stringently checking version may be created
-by recompilation; see the source.