PBeFS
Parallel Best-First Search
Loading...
Searching...
No Matches
NodePool.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*---------------------------- File NodePool.h -----------------------------*/
3/*--------------------------------------------------------------------------*/
16/*--------------------------------------------------------------------------*/
17/*------------------------------ DEFINITIONS -------------------------------*/
18/*--------------------------------------------------------------------------*/
19
20#ifndef __PBeFS_ads_NodePool
21 #define __PBeFS_ads_NodePool
22 /* self-identification: #endif at the end of the file */
23
24/*--------------------------------------------------------------------------*/
25/*-------------------------------- INCLUDES --------------------------------*/
26/*--------------------------------------------------------------------------*/
27
28#include <cstddef>
29
30#include "ADS/memory/Arena.h"
31
33
34/*--------------------------------------------------------------------------*/
35/*------------------------------- NAMESPACE --------------------------------*/
36/*--------------------------------------------------------------------------*/
37
39namespace PBeFS_di_unipi_it
40{
41
42/*--------------------------------------------------------------------------*/
43/*----------------------------- CLASS NodePool -----------------------------*/
44/*--------------------------------------------------------------------------*/
46
47template< class NodeT >
48class NodePool : public ADS::Arena< NodeT , ADS::HugePageAllocator< NodeT > > {
49
50 public:
51
53
54 explicit NodePool( std::size_t chunk = std::size_t( 1 ) << 16 )
55 : ADS::Arena< NodeT , ADS::HugePageAllocator< NodeT > >( chunk ) {}
56
58
59 [[nodiscard]] NodeT * allocate( void ) { return( this->make() ); }
60
61 }; // end( class( NodePool ) )
62
63/*--------------------------------------------------------------------------*/
64
65} // end( namespace PBeFS_di_unipi_it )
66
67/*--------------------------------------------------------------------------*/
68
69#endif /* __PBeFS_ads_NodePool */
70
71/*--------------------------------------------------------------------------*/
72/*-------------------------- End File NodePool.h ---------------------------*/
73/*--------------------------------------------------------------------------*/
Header file for the small helpers shared by the searches: a stopwatch, the placement of the workers o...
NodePool(std::size_t chunk=std::size_t(1)<< 16)
constructor, taking the number of nodes of a chunk
Definition NodePool.h:54
NodeT * allocate(void)
returns a new (value-initialized) node, whose address never changes
Definition NodePool.h:59
namespace for the Parallel Best-First Search library
Definition AStar.h:83