Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

memalloc - memory allocator (BS2000)

&pagelevel(4)&pagelevel

Syntax

#include <stdlib.h>

void *memalloc(size_t num); 

Description

memalloc() allocates contiguous memory of num bytes at execution time.
memalloc() passes the request for memory directly to the appropriate operating system
call. This function is particularly suitable for memory areas with a size of more than 2 KB
(see also memfree()).

Return val.

Pointer

to the new memory area
if memalloc() was able to allocate new memory. This pointer may be used
for any data type.

Null pointer

if memalloc() was unable to provide the memory, e.g. because the
available memory space was insufficient for the request.

Notes

The new memory area begins on a double-word boundary.

The requested length num is rounded up to the next multiple of 2  KB.

If the length of the allocated memory area is exceeded when writing, a serious disruption in
working memory may occur.

The memory area requested with memalloc() can be released by using memfree().

See also

memfree().