comp.lang.ada
 help / color / mirror / Atom feed
From: arny@wayback.UUCP (Arny B. Engelson)
Subject: pragmas, validation and garbage collection
Date: Thu, 2-Oct-86 09:37:09 EDT	[thread overview]
Date: Thu Oct  2 09:37:09 1986
Message-ID: <980@wayback.UUCP> (raw)


   I am developing a program in which I need to control garbage collection
for certain data types.  Ada defines pragma Controlled and the generic
procedure Unchecked_Deallocation for doing this.  However, I was surprised
to find that my VALIDATED (on ACVC 1.7) compiler doesn't implement pragma
Controlled! Not only that, but it has an automatic garbage collection
algorithm that I can't seem to turn off.
   According to LRM 2.8:8  "The pragmas defined by the language ... must be
supported by every implementation."  Since pragma Controlled is defined by
the language, how did this compiler get validated without implementing it?
Or can "supporting" this requirement be met through providing some other
mechanism other than pragma Controlled? (Not that I found any other mechanism).
BTW, Unchecked_Deallocation is implemented.
   Are there other validated compilers that don't implement "required" pragmas?
Do the ACVC tests check for this?

   The reason for all this is I have pointers to different data types which I
convert to integer addresses so I can store them all in one queue. The original
pointers get destroyed (unavoidable), and I convert the saved addresses back to
typed pointers to access the data.  Unfortunately, since there are no pointers
to the data while it is on the queue, the garbage collector may free the memory
before I retrieve the data.
   There is way too much data to attempt to keep dummy pointers to fool the
garbage collector or to create duplicate queues for each data type.  Also, I
have to be able to support an unknown number of different types at once.

   Alas, another great idea is thwarted by reality.

Arny Engelson
...bonnie!wayback!arny

             reply	other threads:[~1986-10-02 13:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-10-02 13:37 Arny B. Engelson [this message]
1986-10-03 14:33 ` pragmas, validation and garbage collection Arny B. Engelson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox