malloc, calloc, realloc, free
malloc(n) requests n bytes from the heap, returns void * (or NULL on failure). calloc(count, size) does the same but zero-initializes. realloc(ptr, new_size) resizes (may move the block). free(ptr) releases the memory. The cardinal rules: always check for NULL return, always free what you malloc, never double-free, never use-after-free, never free stack memory. Internally, malloc maintains a free list (or more sophisticated structures like arenas/slabs). The allocator calls sbrk/mmap to get pages from the OS.