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