25 #ifndef _OPENCOG_TLB_H
26 #define _OPENCOG_TLB_H
30 #include <opencog/util/Logger.h>
40 class AtomSpaceBenchmark;
68 friend class ::TLBUTest;
69 friend class ::BasicSaveUTest;
101 throw InvalidParamException(TRACE_INFO,
102 "Bad argument order.");
103 UUID extent = hi - lo + 1;
105 UUID oldlo =
_brk_uuid.fetch_add(extent, std::memory_order_relaxed);
108 throw InvalidParamException(TRACE_INFO,
109 "Bad range reserve.");
117 return _brk_uuid.fetch_add(extent, std::memory_order_relaxed);
127 _brk_uuid.fetch_add(extent, std::memory_order_relaxed);
145 throw InvalidParamException(TRACE_INFO,
146 "Atom is already in the TLB!");
148 atom->_uuid =
_brk_uuid.fetch_add(1, std::memory_order_relaxed);
153 #endif // _OPENCOG_TLB_H
static bool isInvalidHandle(const Handle &h)
std::shared_ptr< Atom > AtomPtr
static UUID getMaxUUID(void)
static void reserve_range(UUID lo, UUID hi)
static void reserve_upto(UUID hi)
static const Handle UNDEFINED
unsigned long UUID
UUID == Universally Unique Identifier.
static bool isValidHandle(const Handle &h)
static UUID reserve_extent(UUID extent)
static std::atomic< UUID > _brk_uuid
static void addAtom(AtomPtr atom)