home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / atari / st / tech / 6609 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  2.4 KB

  1. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!darwin.sura.net!Sirius.dfn.de!rrz.uni-koeln.de!not-for-mail
  2. From: aeg03@rrz.uni-koeln.de (Jan T. Kim)
  3. Newsgroups: comp.sys.atari.st.tech
  4. Subject: Re: Malloc (Was: Sending objc_draw to a buffer)
  5. Date: 12 Jan 1993 21:19:48 +0100
  6. Organization: Regional Computing Center, University of Cologne
  7. Lines: 34
  8. Message-ID: <1iv954INN1geq@rs1.rrz.Uni-Koeln.DE>
  9. References: <1993Jan4.203951.6091@dcs.warwick.ac.uk> <1993Jan6.224937.10888@netcom.com> <wmtwen.726497985@rw8.urc.tue.nl> <1993Jan8.183133.12773@netcom.com>
  10. Reply-To: kim@vax.mpiz-koeln.mpg.dbp.de
  11. NNTP-Posting-Host: rs1.rrz.uni-koeln.de
  12.  
  13. In <1993Jan8.183133.12773@netcom.com> ersmith@netcom.com (Eric R. Smith) writes:
  14.  
  15. >The answer is quite simple: use malloc() and free(). This has 3 advantages:
  16.  
  17. >(1) It will work in accessories, if your library is sensible (most are).
  18. >    The OS Malloc() function cannot be called from accessories at all.
  19.  
  20. I have a question about this. From what  I  understand,  malloc()
  21. manages memory that is in turn allocated by Malloc() from the OS.
  22. The advantage is that memory is allocated in larger  chunks  from
  23. the  OS.  In  other  words,  a  malloc() call will give rise to a
  24. Malloc() call if the malloc() function cannot find a sufficiently
  25. large  chunk  of  memory  within  the memory already owned by the
  26. process. I conclude from this that it may not be entirely safe to
  27. use  malloc()  in accessories. Rather, it must somehow be ensured
  28. that the amount of  malloc()'ed  memory  in  an  accessory  never
  29. exceeds  the  amount of memory which is initially reserved by the
  30. accessory and managed by the accessorie's malloc()  function.  Is
  31. this line of reasoning correct?
  32.  
  33. Two comments on this: Firstly, I have never  understood  why  TOS
  34. won't  let  accessories  Malloc() their own memory, but considers
  35. memory Malloc()'ed by accessories to belong to the  main  process
  36. running  at  the  time  the  Malloc()  occurs. Does anyone know a
  37. sensible reason why that is? Secondly,  this  silly  problem  may
  38. become  increasingly  irrelevant  when  MultiTOS  finally becomes
  39. available...
  40.  
  41. Greetinx, Jan
  42.  
  43.  +- Jan Kim -- X.400:    S=kim;OU=vax;O=mpiz-koeln;P=mpg;A=dbp;C=de -+
  44.  |             Internet: kim@vax.mpiz-koeln.mpg.dbp.de               |
  45.  |                                                                   |
  46.  *----=<  hierarchical systems are for files, not for humans  >=-----*
  47.