home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / os2 / programm / 8086 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.8 KB

  1. Path: sparky!uunet!destroyer!gatech!prism!gb8
  2. From: gb8@prism.gatech.EDU (BEEBE,GARY E)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Problems with realloc
  5. Keywords: errors realloc
  6. Message-ID: <82201@hydra.gatech.EDU>
  7. Date: 28 Jan 93 14:53:47 GMT
  8. Organization: Georgia Institute of Technology
  9. Lines: 33
  10.  
  11.  
  12.  
  13. Good Morning,
  14.  
  15. I am having a bit of trouble with realloc. I am doing a bit of program  
  16. development on a PS/2 Mod 70 E61 w/320 ext. SCSI. I have 16M ram. The
  17. program must read a file of unknown length, a line at a time, store
  18. (and find) an unknown number of sets of a uniquely formatted data. I have 
  19. compiled and linked the C program with the C Set/2 compiler (CSD level 0028)
  20. and linker. With the warning level set to "info", I get no errors or warnings.
  21. This program is non-PM based at this time. I pass it the file name and it 
  22. is to go off and read all the data and store it in an array of pointers to
  23. pointers to the previously defined data structure. 
  24. The code works flawlessly until I read the 78th data entry. I then get an error
  25. (and stack dump) saying that malloc generated a protection violation. I  
  26. stepped the program to the 77 data entry in the debugger. All data variables
  27. look fine, I have no outside indications of any impending disaster. When I
  28. step past the line that reallocates memory for the next data entry...death!
  29.  
  30. If I didn't know any better, I'd suspect that realloc is trying to allocate
  31. a new segment for more data and failing. But, we now have a flat memory model
  32. right? I'm at a loss. This is a serious show stopper. I must be able to calloc
  33. and realloc data items that can grow to greater than 64K. 
  34.  
  35. If anyone has any suggestions on how to resolve this please e-mail me a note.
  36.  
  37. Thanz
  38.  
  39. -- 
  40. BEEBE,GARY E
  41. Georgia Institute of Technology, Atlanta Georgia, 30332
  42. uucp:      ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gb8
  43. Internet: gb8@prism.gatech.edu
  44.