home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mips / 875 < prev    next >
Encoding:
Internet Message Format  |  1992-08-14  |  1.2 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!lll-winken!snll-arpagw!hilary
  2. From: hilary@snll-arpagw.llnl.gov (Hilary Jones)
  3. Newsgroups: comp.sys.mips
  4. Subject: Problem with malloc?
  5. Summary: It gives a segment violation sometimes.
  6. Message-ID: <297@snll-arpagw.llnl.gov>
  7. Date: 13 Aug 92 23:38:40 GMT
  8. Distribution: all
  9. Organization: Sandia National Labs, Livermore, CA
  10. Lines: 15
  11.  
  12. I have a problem with malloc().  The code I am running makes many calls
  13. to malloc for small amounts of memory at a time.  [Actually the program
  14. is calling calloc, but I think I have isolated the problem to malloc().]
  15. By "many calls" I means perhaps 20 or 100.  The amounts of memory range
  16. from 4 bytes to several hundred.  There is never much memory allocated
  17. at any one time before it all gets returned.  Every now and then, the 
  18. program aborts with a segment violation.  The problem is not repeatable;
  19. if I rerun the program from scratch, the problem might not occur, or it
  20. might occur at a different call to malloc.
  21.  
  22. Has anybody seen this problem?  Is there a fix?  I am running RISC/os 4.51 
  23. on an RS2030.  For what it's worth, my disk isn't very reliable -- but I
  24. have never seen a diagnostic when this problem occurs.
  25.  
  26. Hilary
  27.