This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
malloc crashes for values >3500
- From: Martin Osterloh <martin dot osterloh at dartmouth dot edu>
- To: newlib at sourceware dot org
- Date: Wed, 02 Jan 2013 17:29:59 -0500
- Subject: malloc crashes for values >3500
Hi all,
I have a working newlib port for my x86_64 OS. I can do malloc() without
any problems if the size of the memory I request is less than ~3500. I
have enough memory available - far more than 3500.
I am just wondering if anyone of you guys had a hint? My sbrk
implementation is the one that gets shipped with newib:
char * sbrk(int nbytes);
{
char *base;
if (!heap_ptr)
heap_ptr = (char *)&_end;
base = heap_ptr;
heap_ptr += nbytes;
return base;
}
My page size is 4096. One thought that comes to my mind is that I reach
the end of a page and I fail to allocate a new page?
I am keen to hear your opinions.
Thanks,
--Martin