Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some issues with 32-bit builds on allocations support #26467

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/standard/MemDiagnostics.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ iter allocations(minSize: integral = 0) {
extern proc chpl_memtable_size(): c_int;
extern proc chpl_memtable_entry(idx: c_int): c_ptr(void);
extern proc chpl_memtable_next_entry(entry): c_ptr(void);
extern proc chpl_memtable_entry_addr(entry): uint;
extern proc chpl_memtable_entry_size(entry): uint;
extern proc chpl_memtable_entry_addr(entry): c_uintptr;
extern proc chpl_memtable_entry_size(entry): c_size_t;

const hashSize = chpl_memtable_size();
for i in 0..<hashSize {
var entry = chpl_memtable_entry(i);
while entry != nil {
var addr = chpl_memtable_entry_addr(entry);
var size = chpl_memtable_entry_size(entry);
var addr = chpl_memtable_entry_addr(entry): uint;
var size = chpl_memtable_entry_size(entry): uint;

if size >= minSize then yield (addr,size);

Expand Down
4 changes: 2 additions & 2 deletions runtime/include/chplmemtrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ void chpl_stopVerboseMemHere(void);
int chpl_memtable_size(void);
void* chpl_memtable_entry(int idx);
void* chpl_memtable_next_entry(void* entry);
uint64_t chpl_memtable_entry_addr(void* entry);
uint64_t chpl_memtable_entry_size(void* entry);
uintptr_t chpl_memtable_entry_addr(void* entry);
size_t chpl_memtable_entry_size(void* entry);

///// These entry points are the essential memory tracking interface, called
// at memory allocation and deallocation points.
Expand Down
8 changes: 4 additions & 4 deletions runtime/src/chplmemtrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,12 +804,12 @@ void* chpl_memtable_next_entry(void* entry) {
return (void*)(((memTableEntry*)entry)->nextInBucket);
}

uint64_t chpl_memtable_entry_addr(void* entry) {
return (uint64_t)(((memTableEntry*)entry)->memAlloc);
uintptr_t chpl_memtable_entry_addr(void* entry) {
return (uintptr_t)(((memTableEntry*)entry)->memAlloc);
}

uint64_t chpl_memtable_entry_size(void* entry) {
size_t chpl_memtable_entry_size(void* entry) {
memTableEntry* _entry = (memTableEntry*)entry;
return (uint64_t)(_entry->size*_entry->number);
return (size_t)(_entry->size*_entry->number);
}

Loading