Blender V4.3
mallocn_inline.hh File Reference
#include <cstdlib>

Go to the source code of this file.

Macros

#define __has_feature(x)   0
 
#define ASAN_POISON_MEMORY_REGION(addr, size)   (void)(0 && ((size) != 0 && (addr) != NULL))
 
#define ASAN_UNPOISON_MEMORY_REGION(addr, size)   (void)(0 && ((size) != 0 && (addr) != NULL))
 

Functions

MEM_INLINE bool MEM_size_safe_multiply (size_t a, size_t b, size_t *result)
 
MEM_INLINE void MEM_trigger_error_on_memory_block (const void *, const size_t)
 

Macro Definition Documentation

◆ __has_feature

#define __has_feature ( x)    0

Definition at line 18 of file mallocn_inline.hh.

◆ ASAN_POISON_MEMORY_REGION

#define ASAN_POISON_MEMORY_REGION ( addr,
size )   (void)(0 && ((size) != 0 && (addr) != NULL))

Definition at line 27 of file mallocn_inline.hh.

◆ ASAN_UNPOISON_MEMORY_REGION

#define ASAN_UNPOISON_MEMORY_REGION ( addr,
size )   (void)(0 && ((size) != 0 && (addr) != NULL))

Definition at line 28 of file mallocn_inline.hh.

Function Documentation

◆ MEM_size_safe_multiply()

MEM_INLINE bool MEM_size_safe_multiply ( size_t a,
size_t b,
size_t * result )

◆ MEM_trigger_error_on_memory_block()

MEM_INLINE void MEM_trigger_error_on_memory_block ( const void * ,
const size_t  )

Util to trigger an error for the given memory block.

When ASAN is available, it will poison the memory block before accessing it, to trigger a detailed ASAN report. Otherwise, it will abort if aborting on assert is set.

Definition at line 82 of file mallocn_inline.hh.

Referenced by report_error_on_address(), and report_error_on_address().