Malloc

/ˈmæl.ɒk/ · Noun · Development

Definitions

  1. The C standard library function (`memory allocate`) that requests a block of uninitialized heap memory of a specified size in bytes, returning a void pointer to the allocated region. The caller is responsible for eventually calling `free()` to avoid memory leaks.

    In plain English: A C function that asks the operating system for a chunk of memory, which you must remember to give back when you're done with it.

    Example: "We malloc'd a 64KB buffer for the read, but forgot to free it in the error path — Valgrind caught the leak."

Related Terms