C memory management library

Functions Defined in header <stdlib.h> malloc allocates memory (function) calloc allocates and zeroes memory (function) realloc expands previously allocated memory block (function) free deallocates previously allocated memory (function) aligned_alloc (C11) allocates aligned memory (function) References C11 standard (ISO/IEC 9899:2011): 7.22.3 Memory management functions (p: 347-349) C99 standard (ISO/IEC 9899:1999): 7.20.3 Memory management funct

Identifier

An identifier is an arbitrarily long sequence of digits, underscores, lowercase and uppercase Latin letters, and Unicode characters specified using \u and \U escape notation (since C99). A valid identifier must begin with a non-digit character (Latin letter, underscore, or Unicode non-digit character (since C99)). Identifiers are case-sensitive (lowercase and uppercase letters are distinct). It is implementation-defined if raw (not escaped) Unicode characters are allowed in identifiers. (since

ungetwc

Defined in header <wchar.h> wint_t ungetwc( wint_t ch, FILE *stream ); (since C95) Puts the wide character ch back to the given file stream. Only one wide character pushback is guaranteed. Parameters ch - wide character to be put back stream - file stream to put the wide character back to Return value On success ch is returned. On failure WEOF is returned and the given stream remains unchanged. References C11 standard (ISO/IEC 9899:2011): 7.29.3.10

ccoshf

Defined in header <complex.h> float complex ccoshf( float complex z ); (1) (since C99) double complex ccosh( double complex z ); (2) (since C99) long double complex ccoshl( long double complex z ); (3) (since C99) Defined in header <tgmath.h> #define cosh( z ) (4) (since C99) 1-3) Computes the complex hyperbolic cosine of z. 4) Type-generic macro: If z has type long double complex, ccoshl is called. if z has type double complex, c

cbrt

Defined in header <math.h> float cbrtf( float arg ); (1) (since C99) double cbrt( double arg ); (2) (since C99) long double cbrtl( long double arg ); (3) (since C99) Defined in header <tgmath.h> #define cbrt( arg ) (4) (since C99) 1-3) Computes the cubic root of arg. 4) Type-generic macro: If arg has type long double, cbrtl is called. Otherwise, if arg has integer type or the type double, cbrt is called. Otherwise, cbrtf is called

atomic_store

Defined in header <stdatomic.h> void atomic_store( volatile A* obj , C desired); (1) (since C11) void atomic_store_explicit( volatile A* obj, C desired, memory_order order ); (2) (since C11) Atomically replaces the value of the atomic variable pointed to by obj with desired. The operation is atomic write operation. The first version orders memory accesses according to memory_order_seq_cst, the second version orders memory accesses according to order. order must be one

ATOMIC_*_LOCK_FREE

Defined in header <stdatomic.h> #define ATOMIC_BOOL_LOCK_FREE /* implementation-defined */ #define ATOMIC_CHAR_LOCK_FREE /* implementation-defined */ #define ATOMIC_CHAR16_T_LOCK_FREE /* implementation-defined */ #define ATOMIC_CHAR32_T_LOCK_FREE /* implementation-defined */ #define ATOMIC_WCHAR_T_LOCK_FREE /* implementation-defined */ #define ATOMIC_SHORT_LOCK_FREE /* implementation-defined */ #define ATOMIC_INT_LOCK_FREE /* implementation-defined */ #define ATOM

union

Usage declaration of a union type

thrd_detach

Defined in header <threads.h> int thrd_detach( thrd_t thr ); (since C11) Detaches the thread identified by thr from the current environment. The resources held by the thread will be freed automatically once the thread exits. Parameters thr - identifier of the thread to detach Return value thrd_success if successful, thrd_error otherwise. References C11 standard (ISO/IEC 9899:2011): 7.26.5.3 The thrd_detach function (p: 383-384) See also thrd_join

return statement

Terminates current function and returns specified value to the caller function. Syntax return expression ; (1) return ; (2) Explanation 1) Evaluates the expression, terminates the current function and returns the result of the expression to the caller (the value returned becomes the value of the function call expression). Only valid if the function return type is not void. 2) Terminates the current function. Only valid if the function return type is void. If the type of th