2 * Copyright 2011, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
5 #ifndef TEAM_MEMORY_BLOCK_MANAGER_H
6 #define TEAM_MEMORY_BLOCK_MANAGER_H
10 #include <Referenceable.h>
11 #include <util/DoublyLinkedList.h>
12 #include <util/OpenHashTable.h>
17 struct MemoryBlockHashDefinition
;
18 class TeamMemoryBlock
;
21 class TeamMemoryBlockManager
24 TeamMemoryBlockManager();
25 ~TeamMemoryBlockManager();
29 TeamMemoryBlock
* GetMemoryBlock(target_addr_t address
);
33 struct MemoryBlockEntry
;
34 struct MemoryBlockHashDefinition
;
35 typedef BOpenHashTable
<MemoryBlockHashDefinition
> MemoryBlockTable
;
36 typedef DoublyLinkedList
<TeamMemoryBlock
> DeadBlockTable
;
40 void _MarkDeadBlock(target_addr_t address
);
41 void _RemoveBlock(target_addr_t address
);
44 friend class TeamMemoryBlockOwner
;
48 MemoryBlockTable
* fActiveBlocks
;
49 DeadBlockTable
* fDeadBlocks
;
53 class TeamMemoryBlockOwner
57 TeamMemoryBlockManager
* manager
);
58 ~TeamMemoryBlockOwner();
60 void RemoveBlock(TeamMemoryBlock
* block
);
63 TeamMemoryBlockManager
* fBlockManager
;
67 #endif // TEAM_MEMORY_BLOCK_MANAGER_H