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
Even if compiled with -maix64size always contains 32bit integer which means one cannot allocate more than 2147483647 bytes. Replacing with atol solves the issue.
With atoi (original):
$ ./eatmemory 3000000000000000
Currently total memory: -4096
Currently avail memory: -4096
Eating 2147483647 bytes in chunks of 1024...
With atol (new):
$ eatmemory 3000000000000000
Currently total memory: -4096
Currently avail memory: -4096
Eating 3000000000000000 bytes in chunks of 1024...
The text was updated successfully, but these errors were encountered:
jose1711
added a commit
to jose1711/eatmemory
that referenced
this issue
Feb 9, 2021
https://github.com/julman99/eatmemory/blob/master/eatmemory.c#L85
Even if compiled with
-maix64
size
always contains 32bit integer which means one cannot allocate more than 2147483647 bytes. Replacing withatol
solves the issue.With
atoi
(original):$ ./eatmemory 3000000000000000 Currently total memory: -4096 Currently avail memory: -4096 Eating 2147483647 bytes in chunks of 1024...
With
atol
(new):$ eatmemory 3000000000000000 Currently total memory: -4096 Currently avail memory: -4096 Eating 3000000000000000 bytes in chunks of 1024...
The text was updated successfully, but these errors were encountered: