mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
m::wasm::Allocator Struct Referenceabstract

#include <WasmDSL.hpp>

Inheritance diagram for m::wasm::Allocator:
[legend]

Public Member Functions

virtual ~Allocator ()
 
virtual void * raw_allocate (uint32_t bytes, uint32_t align=1)=0
 Pre-allocates memory for bytes consecutive bytes with alignment requirement align and returns a raw pointer to the beginning of this memory.
 
virtual Ptr< void > pre_allocate (uint32_t bytes, uint32_t align=1)=0
 Pre-allocates memory for bytes consecutive bytes with alignment requirement align and returns a pointer to the beginning of this memory.
 
virtual Var< Ptr< void > > allocate (U32x1 bytes, uint32_t align=1)=0
 Allocates memory for bytes consecutive bytes with alignment requirement align and returns a pointer to the beginning of this memory.
 
virtual void deallocate (Ptr< void > ptr, U32x1 bytes)=0
 Deallocates the bytes consecutive bytes of allocated memory at address ptr.
 
virtual uint32_t perform_pre_allocations ()=0
 Performs the actual pre-allocations.
 
virtual uint32_t pre_allocated_memory_consumption () const =0
 Returns the pre-allocated memory overall consumption.
 
virtual U32x1 allocated_memory_consumption () const =0
 Returns the allocated memory overall consumption.
 
virtual U32x1 allocated_memory_peak () const =0
 Returns the allocated memory peak consumption.
 
Var< Ptr< void > > allocate (uint32_t bytes, uint32_t align=1)
 
void deallocate (Ptr< void > ptr, uint32_t bytes)
 
template<dsl_primitive T>
Traw_malloc ()
 Pre-allocates memory for exactly one value of type.
 
template<dsl_primitive T, std::size_t L = 1>
Ptr< PrimitiveExpr< T, L > > pre_malloc ()
 Pre-allocates memory for exactly one value of type.
 
template<dsl_primitive T, std::size_t L = 1>
Var< Ptr< PrimitiveExpr< T, L > > > malloc ()
 Allocates memory for exactly one value of type.
 
template<dsl_primitive T>
Traw_malloc (uint32_t count)
 Pre-allocates memory for an array of count consecutive values of type.
 
template<dsl_primitive T, std::size_t L = 1>
Ptr< PrimitiveExpr< T, L > > pre_malloc (uint32_t count)
 Pre-allocates memory for an array of count consecutive values of type.
 
template<dsl_primitive T, std::size_t L = 1, typename U >
requires requires (U &&u) { U32x1(std::forward<U>(u)); }
Var< Ptr< PrimitiveExpr< T, L > > > malloc (U &&count)
 Allocates memory for an array of count consecutive values of type.
 
template<primitive_convertible T>
requires requires (T &&t) { primitive_expr_t<T>(std::forward<T>(t)).template to<void*>(); }
void free (T &&ptr)
 Frees exactly one value of type.
 
void free (T &&ptr, U &&count)
 

Data Fields

template<primitive_convertible T, typename U >
 and { primitive_expr_t<T>(std::forward<T>(t)).template to<void*>()
 Frees count consecutive values of type.
 

Detailed Description

Definition at line 6488 of file WasmDSL.hpp.

Constructor & Destructor Documentation

◆ ~Allocator()

virtual m::wasm::Allocator::~Allocator ( )
inlinevirtual

Definition at line 6491 of file WasmDSL.hpp.

Member Function Documentation

◆ allocate() [1/2]

virtual Var< Ptr< void > > m::wasm::Allocator::allocate ( U32x1  bytes,
uint32_t  align = 1 
)
pure virtual

Allocates memory for bytes consecutive bytes with alignment requirement align and returns a pointer to the beginning of this memory.

Implemented in LinearAllocator.

◆ allocate() [2/2]

Var< Ptr< void > > m::wasm::Allocator::allocate ( uint32_t  bytes,
uint32_t  align = 1 
)
inline

Definition at line 6518 of file WasmDSL.hpp.

References allocate().

Referenced by allocate().

◆ allocated_memory_consumption()

virtual U32x1 m::wasm::Allocator::allocated_memory_consumption ( ) const
pure virtual

Returns the allocated memory overall consumption.

Implemented in LinearAllocator.

◆ allocated_memory_peak()

virtual U32x1 m::wasm::Allocator::allocated_memory_peak ( ) const
pure virtual

Returns the allocated memory peak consumption.

Implemented in LinearAllocator.

◆ deallocate() [1/2]

virtual void m::wasm::Allocator::deallocate ( Ptr< void >  ptr,
U32x1  bytes 
)
pure virtual

Deallocates the bytes consecutive bytes of allocated memory at address ptr.

Implemented in LinearAllocator.

◆ deallocate() [2/2]

void m::wasm::Allocator::deallocate ( Ptr< void >  ptr,
uint32_t  bytes 
)
inline

Definition at line 6519 of file WasmDSL.hpp.

References deallocate().

Referenced by deallocate().

◆ free() [1/2]

template<primitive_convertible T>
requires requires (T &&t) { primitive_expr_t<T>(std::forward<T>(t)).template to<void*>(); }
void m::wasm::Allocator::free ( T &&  ptr)
inline

Frees exactly one value of type.

Template Parameters
Tof allocated memory pointed by ptr.

Definition at line 6577 of file WasmDSL.hpp.

References free().

Referenced by free().

◆ free() [2/2]

void m::wasm::Allocator::free ( T &&  ptr,
U &&  count 
)
inline

Definition at line 6583 of file WasmDSL.hpp.

References m::wasm::L, and m::T().

◆ malloc() [1/2]

template<dsl_primitive T, std::size_t L = 1>
Var< Ptr< PrimitiveExpr< T, L > > > m::wasm::Allocator::malloc ( )
inline

Allocates memory for exactly one value of type.

Template Parameters
Tand number of SIMD lanes
L.Returns a pointer to this memory.

Definition at line 6532 of file WasmDSL.hpp.

◆ malloc() [2/2]

template<dsl_primitive T, std::size_t L = 1, typename U >
requires requires (U &&u) { U32x1(std::forward<U>(u)); }
Var< Ptr< PrimitiveExpr< T, L > > > m::wasm::Allocator::malloc ( U &&  count)
inline

Allocates memory for an array of count consecutive values of type.

Template Parameters
Tand number of SIMD lanes
L.Returns a pointer to this memory.

Definition at line 6553 of file WasmDSL.hpp.

References m::wasm::L, and m::T().

◆ perform_pre_allocations()

virtual uint32_t m::wasm::Allocator::perform_pre_allocations ( )
pure virtual

Performs the actual pre-allocations.

Must be called exactly once after the last pre-allocation was requested. Returns the initial allocation address, i.e. an address after the last pre-allocated address.

Implemented in LinearAllocator.

◆ pre_allocate()

virtual Ptr< void > m::wasm::Allocator::pre_allocate ( uint32_t  bytes,
uint32_t  align = 1 
)
pure virtual

Pre-allocates memory for bytes consecutive bytes with alignment requirement align and returns a pointer to the beginning of this memory.

Implemented in LinearAllocator.

◆ pre_allocated_memory_consumption()

virtual uint32_t m::wasm::Allocator::pre_allocated_memory_consumption ( ) const
pure virtual

Returns the pre-allocated memory overall consumption.

Implemented in LinearAllocator.

◆ pre_malloc() [1/2]

template<dsl_primitive T, std::size_t L = 1>
Ptr< PrimitiveExpr< T, L > > m::wasm::Allocator::pre_malloc ( )
inline

Pre-allocates memory for exactly one value of type.

Template Parameters
Tand number of SIMD lanes
L.Returns a pointer to this memory.

Definition at line 6528 of file WasmDSL.hpp.

◆ pre_malloc() [2/2]

template<dsl_primitive T, std::size_t L = 1>
Ptr< PrimitiveExpr< T, L > > m::wasm::Allocator::pre_malloc ( uint32_t  count)
inline

Pre-allocates memory for an array of count consecutive values of type.

Template Parameters
Tand number of SIMD lanes
L.Returns a pointer to this memory.

Definition at line 6541 of file WasmDSL.hpp.

References m::wasm::L, and m::T().

◆ raw_allocate()

virtual void * m::wasm::Allocator::raw_allocate ( uint32_t  bytes,
uint32_t  align = 1 
)
pure virtual

Pre-allocates memory for bytes consecutive bytes with alignment requirement align and returns a raw pointer to the beginning of this memory.

Implemented in LinearAllocator.

◆ raw_malloc() [1/2]

template<dsl_primitive T>
T * m::wasm::Allocator::raw_malloc ( )
inline

Pre-allocates memory for exactly one value of type.

Template Parameters
T.Returns a raw pointer to this memory.

Definition at line 6524 of file WasmDSL.hpp.

References m::T().

◆ raw_malloc() [2/2]

template<dsl_primitive T>
T * m::wasm::Allocator::raw_malloc ( uint32_t  count)
inline

Pre-allocates memory for an array of count consecutive values of type.

Template Parameters
T.Returns a raw pointer to this memory.

Definition at line 6537 of file WasmDSL.hpp.

References m::T().

Field Documentation

◆ and

template<primitive_convertible T, typename U >
m::wasm::Allocator::and { primitive_expr_t<T>(std::forward<T>(t)).template to<void*>()

Frees count consecutive values of type.

Template Parameters
Tof allocated memory pointed by ptr.

Definition at line 6581 of file WasmDSL.hpp.


The documentation for this struct was generated from the following file: