| 1 | // -*- C++ -*-cxx . . $ `<file>/vendor/Heap-Layers/utility/freesllist.h`/ |
| 2 | |
| 3 | #ifndef HL_FREESLLIST_H_ |
| 4 | #define HL_FREESLLIST_H_cxx . . $ `vendor/Heap-Layers/utility/freesllist.h:4:9`! |
| 5 | |
| 6 | #include <assert.h> |
| 7 | |
| 8 | /** |
| 9 | * @class FreeSLList |
| 10 | * @brief A "memory neutral" singly-linked list, |
| 11 | * |
| 12 | * Uses the free space in objects to store |
| 13 | * the pointers. |
| 14 | */ |
| 15 | |
| 16 | |
| 17 | class FreeSLListcxx . . $ FreeSLList# { |
| 18 | public: |
| 19 | |
| 20 | inline void clearcxx . . $ FreeSLList#clear(49f6e7a06ebc5aa8).() { |
| 21 | headcxx . . $ FreeSLList#head..nextcxx . . $ FreeSLList#Entry#next. = nullptr; |
| 22 | } |
| 23 | |
| 24 | class Entrycxx . . $ FreeSLList#Entry#; |
| 25 | |
| 26 | /// Get the head of the list. |
| 27 | inline Entrycxx . . $ FreeSLList#Entry# * getcxx . . $ FreeSLList#get(13b025859b95b63e).() { |
| 28 | const Entrycxx . . $ FreeSLList#Entry# * e = headcxx . . $ FreeSLList#head..nextcxx . . $ FreeSLList#Entry#next.; |
| 29 | if (e == nullptr) { |
| 30 | return nullptr; |
| 31 | } |
| 32 | headcxx . . $ FreeSLList#head..nextcxx . . $ FreeSLList#Entry#next. = e->nextcxx . . $ FreeSLList#Entry#next.; |
| 33 | return const_cast<Entrycxx . . $ FreeSLList#Entry# *>(e); |
| 34 | } |
| 35 | |
| 36 | inline Entrycxx . . $ FreeSLList#Entry# * removecxx . . $ FreeSLList#remove(13b025859b95b63e).() { |
| 37 | const Entrycxx . . $ FreeSLList#Entry# * e = headcxx . . $ FreeSLList#head..nextcxx . . $ FreeSLList#Entry#next.; |
| 38 | if (e == nullptr) { |
| 39 | return nullptr; |
| 40 | } |
| 41 | headcxx . . $ FreeSLList#head..nextcxx . . $ FreeSLList#Entry#next. = e->nextcxx . . $ FreeSLList#Entry#next.; |
| 42 | return const_cast<Entrycxx . . $ FreeSLList#Entry# *>(e); |
| 43 | } |
| 44 | |
| 45 | inline void insertcxx . . $ FreeSLList#insert(5d22bdacc48458e8). (void * e) { |
| 46 | Entrycxx . . $ FreeSLList#Entry# * entry = reinterpret_cast<Entrycxx . . $ FreeSLList#Entry# *>(e); |
| 47 | entry->nextcxx . . $ FreeSLList#Entry#next. = headcxx . . $ FreeSLList#head..nextcxx . . $ FreeSLList#Entry#next.; |
| 48 | headcxx . . $ FreeSLList#head..nextcxx . . $ FreeSLList#Entry#next. = entry; |
| 49 | } |
| 50 | |
| 51 | class Entrycxx . . $ FreeSLList#Entry# { |
| 52 | public: |
| 53 | Entrycxx . . $ FreeSLList#Entry#Entry(49f6e7a06ebc5aa8).() |
| 54 | : nextcxx . . $ FreeSLList#Entry#next. (nullptr) |
| 55 | {} |
| 56 | Entrycxx . . $ FreeSLList#Entry# * nextcxx . . $ FreeSLList#Entry#next.; |
| 57 | private: |
| 58 | Entrycxx . . $ FreeSLList#Entry#Entry(41f22ae6b084589). (const Entrycxx . . $ FreeSLList#Entry#&); |
| 59 | Entrycxx . . $ FreeSLList#Entry#& operatorcxx . . $ FreeSLList#Entry#`operator=`(590d77279fdc30e3).=(const Entrycxx . . $ FreeSLList#Entry#&); |
| 60 | }; |
| 61 | |
| 62 | private: |
| 63 | Entrycxx . . $ FreeSLList#Entry# headcxx . . $ FreeSLList#head.; |
| 64 | }; |
| 65 | |
| 66 | |
| 67 | #endif |
| 68 | |
| 69 | |
| 70 | |
| 71 |