This is the mail archive of the newlib@sourceware.org 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]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]