This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
int size = 1024*1024; char *c = malloc(62 * size);
This allocates 62MB of memory just fine (the XBOX has 64MB physical RAM). If I use 63, then it hangs (which I am investigating separately). So, I know that I can successfully allocate up to at least 62MB.
Now, if I change the program to look like:
int size = 1024*1024;
for (int i = 0; i < 62; i++)
char *c = malloc(size);
I would have suspected that this should work too, but it only manages to allocate eight buffers. Why such a disparity? I might have understood if it could only get to 61 or 60, but only 8?
Cheers Nick
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |