zos: fix uv_get_free_memory()
The previous implementation of `uv_get_free_memory()` on z/OS return incorrect values. This is because the rceafc field being dereferenced for the memory values needs to be treated as unsigned int. Co-authored-by: Igor Todorovski <itodorov@ca.ibm.com> Co-authored-by: Alex Yung <alex.yung@ibm.com> Co-authored-by: CW Cheung <ccw.280231@ca.ibm.com> PR-URL: https://github.com/libuv/libuv/pull/3141 Reviewed-By: Richard Lau <rlau@redhat.com>
This commit is contained in:
parent
bd4a357b3d
commit
f15216e9dd
@ -182,7 +182,7 @@ uint64_t uv_get_free_memory(void) {
|
||||
data_area_ptr rcep = {0};
|
||||
cvt.assign = *(data_area_ptr_assign_type*)(CVT_PTR);
|
||||
rcep.assign = *(data_area_ptr_assign_type*)(cvt.deref + CVTRCEP_OFFSET);
|
||||
freeram = *((uint64_t*)(rcep.deref + RCEAFC_OFFSET)) * 4;
|
||||
freeram = (uint64_t)*((uint32_t*)(rcep.deref + RCEAFC_OFFSET)) * 4096;
|
||||
return freeram;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user