You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/MemoryBankManager.h
+13-2Lines changed: 13 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,21 @@ class MemoryBankManager {
21
21
~MemoryBankManager(); // destructor
22
22
23
23
intaddBank(std::shared_ptr<MemoryBank> bankPtr, std::string name=""); // add a named memory bank to the manager. By default, takes name from bank description
24
-
std::shared_ptr<MemoryPagesPool> getPagedPool(size_t pageSize, size_t pageNumber, std::string bankName=""); // get a pool of pages from the manager
24
+
25
+
// get a pool of pages from the manager, using the banks available
26
+
// parameters:
27
+
// - pageSize: size of one page (in bytes)
28
+
// - pageNumber: number of pages requested
29
+
// - bankName: name of the bank from which to create the pool. If not specified, using the first bank.
30
+
// - pageAlign: alignment of first page in pool
31
+
// - blockAlign: alignment of beginning of big memory block from which pool is created
32
+
// NB: trivial implementation, once a region from a bank has been used, it can not be reused after the corresponding pool of pages has been release
33
+
// ... don't want to deal with fragmentation etc
34
+
std::shared_ptr<MemoryPagesPool> getPagedPool(size_t pageSize, size_t pageNumber, std::string bankName="", int pageAlign=0, int blockAlign=0);
25
35
26
36
// a struct to define a memory range
27
37
structmemoryRange {
28
-
size_t offset; // beginning of memory range (bytes)
38
+
size_t offset; // beginning of memory range (bytes, counted from beginning of block)
29
39
size_t size; // size of memory range (bytes)
30
40
};
31
41
@@ -42,6 +52,7 @@ class MemoryBankManager {
42
52
std::mutex bankMutex; // instance mutex to handle concurrent access to public methods
0 commit comments