comp.lang.ada
 help / color / mirror / Atom feed
* pragmas, validation and garbage collection
@ 1986-10-02 13:37 Arny B. Engelson
  1986-10-03 14:33 ` Arny B. Engelson
  0 siblings, 1 reply; 2+ messages in thread
From: Arny B. Engelson @ 1986-10-02 13:37 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1986-10-03 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1986-10-02 13:37 pragmas, validation and garbage collection Arny B. Engelson
1986-10-03 14:33 ` Arny B. Engelson

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