docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
Size Operations

Functions for computing sizes of types and dynamic allocations. More...

Classes

class  sdfg::symbolic::SizeOfTypeFunction
 Function class representing sizeof for a type. More...
class  sdfg::symbolic::DynamicSizeOfFunction
 Function class for dynamic sizeof operation. More...
class  sdfg::symbolic::MallocUsableSizeFunction
 Function class for malloc_usable_size operation. More...

Functions

Expression sdfg::symbolic::size_of_type (const types::IType &type)
 Computes the size of a type.
Expression sdfg::symbolic::dynamic_sizeof (const Symbol symbol)
 Computes the dynamic size of a memory region.
Expression sdfg::symbolic::malloc_usable_size (const Symbol symbol)
 Computes the usable size of a malloc allocation.

Detailed Description

Functions for computing sizes of types and dynamic allocations.

Function Documentation

◆ dynamic_sizeof()

Expression sdfg::symbolic::dynamic_sizeof ( const Symbol symbol)

Computes the dynamic size of a memory region.

Parameters
symbolSymbol representing a memory allocation
Returns
Expression representing the dynamic size of the allocation

This is used for dynamically-sized allocations where the size is not known statically.

◆ malloc_usable_size()

Expression sdfg::symbolic::malloc_usable_size ( const Symbol symbol)

Computes the usable size of a malloc allocation.

Parameters
symbolSymbol representing a malloc'd pointer
Returns
Expression representing malloc_usable_size(symbol)

This represents the actual usable size of a memory allocation, which may be larger than the requested size due to allocator alignment.

◆ size_of_type()

Expression sdfg::symbolic::size_of_type ( const types::IType & type)

Computes the size of a type.

Parameters
typeThe type to compute the size of
Returns
Expression representing sizeof(type)