This is the mail archive of the glibc-linux@ricardo.ecn.wfu.edu mailing list for the glibc project.


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

Malloc's Behavior


I have a short program on Pentium, Red-Hat Linux that does the following:

malloc(100);
malloc(300000)
malloc(100);

In addition the pointers returned by malloc are printed. I find that 
the first and the third calls give me pointers at about 130 MB, which seems
ok. The second gives me a pointer at 1.03 GB position, which seems
too high. After a few more allocations, the program get a setmentation
fault in a subsequent call to malloc().  There is no call to free() or
realloc(). Any insight will be appreciated.

Dhiraj Sharma
dhirajsharma@compuserve.com

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