malloc man page on Inferno

Man page or keyword search:  
man Server   579 pages
apropos Keyword Search (all sections)
Output format
Inferno logo
[printable version]

MALLOC(10.2)							  MALLOC(10.2)

NAME
       malloc, mallocz, smalloc, free, realloc, calloc - kernel memory alloca‐
       tors

SYNOPSIS
       void* malloc(ulong size)

       void* mallocz(ulong size, int clr)

       void* smalloc(ulong size)

       void* realloc(void *p, ulong size)

       void* calloc(ulong n, ulong szelem)

       void  free(void *p)

DESCRIPTION
       These functions allocate memory from the mainmem memory pool.  All  but
       smalloc (which sleeps) may safely be called by interrupt handlers.

       Malloc returns a pointer to a block of at least size bytes, initialised
       to zero.	 The result is aligned on a 32-bit boundary.  Mallocz is simi‐
       lar, but only clears the memory if clr is non-zero.

       Smalloc	returns	 a  pointer  to	 a block of size bytes, initialised to
       zero.  If the memory is	not  immediately  available,  smalloc  retries
       every 100 milliseconds until the memory is acquired.

       Calloc  returns	a  pointer  to	a block of memory of at least n*szelem
       bytes, initialised to zero.

       Realloc changes the size of the block pointed to by p to size bytes, if
       possible	 without  moving the data, and returns a pointer to the block.
       The contents are unchanged up to the lesser of old and new  sizes,  and
       any  new	 space	allocated  is  initialised  to	zero.	If p is a null
       pointer, realloc returns the equivalent of malloc(size).

       The argument to free is a pointer to a block of memory allocated by one
       of  the	routines above, which is returned to the allocation pool, or a
       null pointer, which is ignored.

DIAGNOSTICS
       All functions except smalloc return a null pointer if space is unavail‐
       able.

SEE ALSO
       xalloc(10.2)

								  MALLOC(10.2)
[top]

List of man pages available for Inferno

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net