NEW

Table of Contents

NEW

Description

Allocates zero-initialized memory for a type.

Parameters

NameDirectionDescription
tnameinType name to allocate memory for.

Success

Returns pointer to zero-initialized memory block.

Failure

Returns NULL if memory allocation fails.

Usage example (Cross-references)

    
    SysMutex* SysMutexCreate(void) {
    SysMutex* m = NEW(SysMutex);
    #ifdef _WIN32
    InitializeCriticalSection(&m->lock);
    }
    
    SysProcInfo* proc_info = NEW(SysProcInfo);
    if (!proc_info) {
    LOG_ERROR("Failed to allocate process info");

Share :

Related Posts

ALIGN_UP

ALIGN_UP Description Aligns the given value up to the nearest multiple of alignment.

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