Safe memory allocation

Overview

Safe memory allocation

Copyright (C) 2004-2022 OKTET Labs Ltd. More…

// global functions

void* te_alloc_internal(size_t size, const char* filename, int line);

// macros

#define TE_ALLOC(_size)

Detailed Documentation

Safe memory allocation

Copyright (C) 2004-2022 OKTET Labs Ltd. All rights reserved.

Global Functions

void* te_alloc_internal(size_t size, const char* filename, int line)

Allocate size bytes and fill allocated memory with zeroes. Logs an error if the memory cannot be allocated. This function should never be called directly, use TE_ALLOC() macro instead

Parameters:

size

Number of bytes to allocate

filename

Caller’s filename

line

Caller’s line

Macros

#define TE_ALLOC(_size)

It is a wrapper for te_alloc_internal()

Parameters:

_size

Number of bytes to allocate