From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!crdgw1!minerva!kassover From: kassover@minerva.crd.ge.com (David Kassover) Newsgroups: comp.lang.ada Subject: Re: C Strings in Ada? Message-ID: <8446@crdgw1.crd.ge.com> Date: 11 Jun 90 14:59:25 GMT References: <920024@hpclapd.HP.COM> <920025@hpclapd.HP.COM> <1304@software.software.org> <57245@bbn.BBN.COM> Sender: news@crdgw1.crd.ge.com Organization: Aule-Tek, Inc. List-Id: In article <57245@bbn.BBN.COM> adoyle@vax.bbn.com (Allan Doyle) writes: ... > >Judging from the replies about heap space, I'm getting a little worried. >Do you guys mean to tell me that it's compiler dependent how to allocate >the 'c_string' constant? This is just the sort of thing that makes me >mistrust Ada for a realtime application that has to run for a long time >without any memory leaks. If I take the worst case assumption that c_string >is being allocated from the heap and add it to the worst case assumption >that my Ada run-time will not be doing garbage collection (perfectly legal, >I understand), then how many of these little beasties can I convert from >Ada to C before I run out of memory? Perhaps I'm naive. But isn't management of things like heaps and stacks and stuff the purview of the underlying hardware and operating system (if any?) Under VMS, regardless of language used (well, take my absolutes as approximately equal to .9944 8-), heap, stack, vm, etc management can be affected by several parameters pertaining to the operating system, the user account structure, and the current hardware configuration. On the other hand, if you *have* no operating system (your program lives in an automated teller machine, e.g.) then when you run out of memory depends on how much you have and how busy your program was. If this is a problem, then you must write a garbage collector yourself (and find room for it in memory 8-), or get the powers that be to plug in a bigger memory board, or poll the ATM more frequently. And furthermore, if what you are writing *is* an operating system (in the sense of, say, OS 360, MS-DOS, VAX-VMS, VM/CMS, Primos, or bhog-knows-what), then you *also* might consider writing a garbage collector, and publishing instructions to writers of compilers on how to take advantage of it. But that has nothing, IMHO, to do with Ada. Or have I missed a point here? -- David Kassover "Proper technique helps protect you against kassover@ra.crd.ge.com sharp weapons and dull judges." kassover@crd.ge.com F. Collins