Heap memory

    Using dynamic memory

    provides with standard library functions to access, modify and manage dynamic memory. Commonly used functions include malloc and free:

    It is important to note that these memory allocation functions are provided by the standard library. These functions provide a layer between the developer and the operating system that efficiently manages heap memory. It is the responsibility of the developer to ‘free’ any allocated memory after using it exactly once. Internally, these functions use two system calls and mmap to request and release heap memory from the operating system. post discusses these system calls in detail.