GrPPI  0.3.1
Generic and Reusable Parallel Pattern Interface
fastflow_allocator.h
Go to the documentation of this file.
1 
21 #ifndef GRPPI_FF_DETAIL_FASTFLOW_ALLOCATOR_H
22 #define GRPPI_FF_DETAIL_FASTFLOW_ALLOCATOR_H
23 
24 #include <ff/allocator.hpp>
25 
26 namespace grppi {
27 
28 namespace detail_ff {
29 
35 struct ff_arena_t {};
36 
41 constexpr ff_arena_t ff_arena;
42 
43 
44 } // namespace detail_ff
45 
46 } // namespace grppi
47 
53 inline void * operator new(
54  std::size_t sz,
55  const grppi::detail_ff::ff_arena_t &) noexcept
56 {
57  return ::ff::ff_malloc(sz);
58 }
59 
65 inline void operator delete(
66  void * ptr,
67  const grppi::detail_ff::ff_arena_t &) noexcept
68 {
69  ::ff::ff_free(ptr);
70 }
71 
72 #endif
Definition: callable_traits.h:26
constexpr ff_arena_t ff_arena
Fastflow arena object. This object will be passed to placement new/delete to use FastFlow allocation ...
Definition: fastflow_allocator.h:41
Tag type for fastflow allocation. This empty type is used to select the overloaded placement new and ...
Definition: fastflow_allocator.h:35