YAMI4 Core Library 2.0.0
Messaging Solution for Distributed Systems
Loading...
Searching...
No Matches
Public Member Functions | List of all members
yami::core::non_locked_allocator Class Reference

Non-locking (thread-unsafe) block-based allocator. More...

#include <allocator.h>

Inheritance diagram for yami::core::non_locked_allocator:
yami::core::allocator

Public Member Functions

void set_working_area (void *buf, std::size_t size)
 
virtual void * allocate (std::size_t requested_size)
 
virtual void deallocate (const void *p)
 
void get_free_size (std::size_t &biggest, std::size_t &all) const
 
virtual void * allocate (std::size_t requested_size)=0
 
virtual void deallocate (const void *p)=0
 

Detailed Description

Non-locking (thread-unsafe) block-based allocator.

The block-based allocator operates within the given block of memory. This allocator uses a straightforward implementation with lists of free blocks, which are coalesced at deallocation time. It is appropriate for repeated alloc/dealloc patterns, but is vulnerable to fragmentation with irregular request sequences. This allocator should be protected by a locking wrapper, if intended for use in a multithreading environment.

Member Function Documentation

◆ allocate()

virtual void * yami::core::non_locked_allocator::allocate ( std::size_t  requested_size)
virtual

Implements yami::core::allocator.

◆ deallocate()

virtual void yami::core::non_locked_allocator::deallocate ( const void *  p)
virtual

Implements yami::core::allocator.


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