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 autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!hagerp From: hagerp@iuvax.cs.indiana.edu Newsgroups: comp.lang.ada Subject: S/W Engineering question Message-ID: <15800008@iuvax> Date: 28 Dec 89 15:02:00 GMT Organization: Indiana University CSCI, Bloomington Nf-ID: #N:iuvax:15800008:000:1110 Nf-From: iuvax.cs.indiana.edu!hagerp Dec 28 10:02:00 1989 List-Id: I am interested in getting some feedback on the ramifications of the following design decision and one example of the implementation. An operating system is designed and written in C. It is desired that all application programs that run on this system, however, be written in Ada. Therefore, all necessary system calls are encapsulated in a set of Ada interface packages. The system provides a facility to allocate a buffer for a user application called "Get". "Get" is similar to "malloc" in that it returns a pointer (this is C, remember) to the buffer. The Ada interface defines a routine "GET_BUF" (that actually calls "Get") as follows: generic type BUFFER_TYPE is private; type POINTER_TYPE is access BUFFER_TYPE; package ALLOCATE_BUFFER is procedure GET_BUF (PTR_BUFFER : in out POINTER_TYPE); procedure FREE_BUF (PTR_BUFFER : in POINTER_TYPE); end ALLOCATE_BUFFER; After an application instantiates the ALLOCATE_BUFFER package, a call to "GET_BUF" returns an access type for BUFFER_TYPE. I'm very interested in any comments. --paul hager hagerp@iuvax.cs.indiana.edu