Early warning on memory address
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
#include <absl/types/compare.h>
|
#include <absl/types/compare.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <climits>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
@@ -103,6 +104,7 @@ void PimMemory::allocateGatheredMemory() {
|
|||||||
|
|
||||||
void PimMemory::allocateMemoryForValue(const MemoryValueKey& key, MemEntry& memEntry) {
|
void PimMemory::allocateMemoryForValue(const MemoryValueKey& key, MemEntry& memEntry) {
|
||||||
memEntry.address = firstAvailableAddress;
|
memEntry.address = firstAvailableAddress;
|
||||||
|
assert(memEntry.address < (size_t) INT_MAX && "Address allocated bigger than 32bit");
|
||||||
firstAvailableAddress += memEntry.size;
|
firstAvailableAddress += memEntry.size;
|
||||||
// Alignment
|
// Alignment
|
||||||
if (size_t remainder = firstAvailableAddress % minAlignment)
|
if (size_t remainder = firstAvailableAddress % minAlignment)
|
||||||
|
|||||||
Reference in New Issue
Block a user