Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ set_sbrk_size.bsd(2) — Domain/IX SR9.2.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

brk(2)

sbrk(2)

calloc(3)

malloc(3)

realloc(3)

environ(7)

SET_SBRK_SIZE(2)

NAME

set_sbrk_size − define memory available for allocation

USAGE

set_sbrk_size (newsize)
int newsize;

DESCRIPTION

The DOMAIN/IX function set_sbrk_size defines the amount of memory available for allocation by the memory allocation functions sbrk, brk, malloc, realloc, and calloc. 

Set_sbrk_size is necessary because of the differences between the memory management structure of DOMAIN/IX and that of other UNIX systems.  The DOMAIN memory allocation scheme is allowed to use the “holes” left in the address space when something is unmapped.  This results in non-contiguous virtual address space.  In order for it to guarantee a contiguous sbrk area, DOMAIN/IX must inform the kernel of the area’s size at the time of the first call to brk(2), or sbrk(2). 

The default size of the sbrk area is 256 Kb.  Use this function before the first call to any of the memory allocation functions to change the value of sbrk. 

NOTES

No sanity check is performed on (newsize) until the first call to brk or sbrk.  If (newsize) exceeds the amount of memory available when sbrk is called, sbrk will fail, regardless of the amount of memory requested.  Appropriate values for (newsize) are highly machine-dependant.  In no event can (newsize) exceed the difference between total mappable address space and that portion of the space already mapped. 

If set_sbrk_size isn’t called, DOMAIN/IX checks the environment variable SBRKSIZE at the first call to brk(2) or sbrk(2).  If SBRKSIZE is set to a valid decimal integer, this becomes the sbrk size. 

RELATED INFORMATION

brk(2), sbrk(2), calloc(3), malloc(3), realloc(3) environ(7)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026