FREE

Table of Contents

FREE

Description

Safely deallocates memory and nullifies pointer.

Parameters

NameDirectionDescription
xin,outPointer variable to free.

Success

Memory is deallocated and pointer set to NULL.

Failure

Function cannot fail - safe to call with NULL.

Usage example (Cross-references)

    
    if (*zs)
    FREE(*zs);
    }
    ValidateStr(copy);
    if (copy->data) {
    FREE(copy->data);
    }
    *copy = StrInit();
    ValidateBitVec(bitvec);
    if (bitvec->data) {
    FREE(bitvec->data);
    bitvec->data = NULL;
    }
    if (bv->length == 0) {
    // Free all memory if empty
    FREE(bv->data);
    bv->data      = NULL;
    bv->capacity  = 0;
    
    if (!prev_row || !curr_row) {
    FREE(prev_row);
    FREE(curr_row);
    LOG_FATAL("Memory allocation failed");
    if (!prev_row || !curr_row) {
    FREE(prev_row);
    FREE(curr_row);
    LOG_FATAL("Memory allocation failed");
    }
    
    u64 result = prev_row[len2];
    FREE(prev_row);
    FREE(curr_row);
    u64 result = prev_row[len2];
    FREE(prev_row);
    FREE(curr_row);
    
    return result;
    #endif
    memset(m, 0, sizeof(SysMutex));
    FREE(m);
    }
    CloseHandle(proc->pi.hProcess);
    #endif
    FREE(proc);
    }

Share :

Related Posts

LVAL

LVAL Description Creates a temporary, addressable l-value from a given expression x.

Read More

ALIGN_DOWN_POW2

ALIGN_DOWN_POW2 Description Aligns the given value down to the nearest power-of-two multiple.

Read More

ALIGN_UP_POW2

ALIGN_UP_POW2 Description Aligns the given value up to the nearest power-of-two multiple.

Read More