5#ifndef YAMICORE_LOCKED_ALLOCATOR_H_INCLUDED
6#define YAMICORE_LOCKED_ALLOCATOR_H_INCLUDED
25 void set_working_area(
void * buf, std::size_t size)
27 alloc_.set_working_area(buf, size);
30 virtual void * allocate(std::size_t requested_size)
32 std::lock_guard<std::mutex> lock(mtx_);
34 void *
result = alloc_.allocate(requested_size);
39 virtual void deallocate(
const void * p)
41 std::lock_guard<std::mutex> lock(mtx_);
46 void get_free_size(std::size_t & biggest, std::size_t & all)
const
48 std::lock_guard<std::mutex> lock(mtx_);
50 alloc_.get_free_size(biggest, all);
58 mutable std::mutex mtx_;
Common interface for the custom memory allocator.
Definition: allocator.h:20
Locking (thread-safe) wrapper for the block-based allocator.
Definition: locked_allocator.h:21
Non-locking (thread-unsafe) block-based allocator.
Definition: allocator.h:46
result
General type for reporting success and error states.
Definition: core.h:21
Namespace devoted for everything related to YAMI4.
Definition: agent.h:14