westley@cs.buffalo.edu (11/16/89)
I have been studying Booch's _Software_Compenents_with_Ada_ and wondered why he did not mention use of unchecked deallocation as a third approach to managing the memory withing a software component that uses access types. If you have his book, I'm refering to section 6.3. For those who don't, he suggested two approaches to managing the memory: 1) letting the compiler/run-time system perform garbage collection, and 2) managing it directly in Ada by using a linked list of free nodes. My question relates to the use of unchecked deallocation. Is it a language requirement that unchecked deallocation work or is this implementation dependent? I have used it in Verdix and Telesoft compilers to successfully manage dynamic memory, but I can't tell from what the reference manual says as to whether it is required. Terry J. Westley Arvin/Calspan Advanced Technology Center P.O. Box 400, Buffalo, NY 14225 planck!hercules!westley@cs.buffalo.edu
madmats%elcit.epfl.ch@CMUCCVMA.cc.cmu.edu (Mats Weber) (11/16/89)
Unchecked_Deallocation is not required to do anymore than setting its parameter to null. Effective deallocation of the memory is not required. However, most systems implement it correctly. I have submitted an Ada-9X revision request that requires Unchecked_Deallocation to work (i.e. to deallocate storage) if automatic garbage collection is not provided. This, however, is quite hard to specify in the way the semantics of the language are given in the LRM. There are other related deficiencies in the LRM. For example, it is not stated that constrained objects must occupy as little space as possible. Even worse, Storage_Error can be raised even at places where it is not 'sensible' to do so. In these areas, it seems that all kinds of abstract specifications of the semantics will fail. Mats Weber Swiss Federal Institute of Technology EPFL DI LITh 1015 Lausanne Switzerland e-mail : madmats@elcit.epfl.ch phone : +41 21 693 42 43