comp.lang.ada
 help / color / mirror / Atom feed
* access / freeing memory
@ 2002-07-16  0:52 Jan Prazak
  2002-07-15 22:22 ` tmoran
  2002-07-18 18:22 ` chris.danx
  0 siblings, 2 replies; 15+ messages in thread
From: Jan Prazak @ 2002-07-16  0:52 UTC (permalink / raw)


Hello,

I have finished reading one Ada tutorial (I won't say that I did
understand everything), but the section about "access" was not very
clearly explained.

Just imagine this simple situation:
I have a single-linked list, with a "head".

head -> 1 -> 2 -> 3 -> null

Is it really possible to say

 head := null; (to delete all elements)

or

 head.next.next := null; (to delete the 3rd element)

or similar things???

This would be a very bad programming technique in Pascal, because this
would create a "memory hole". There each element has to be "disposed" with
a procedure called "Dispose".

The tutorial explains a similar procedure, called Unchecked_Deallocation,
but it's said that it's not recommended to use it (because some other
access type could access that memory address (that's clear)).
So does the operating system take care of the deallocation?
And what about other OSs than Linux? Or has this to do with the Ada
compiler, which maintains the memory (de)allocation? (This would be more
logical.)

Thanks,
Jan




^ permalink raw reply	[flat|nested] 15+ messages in thread
[parent not found: <mailman.1026804243.16337.comp.lang.ada@ada.eu.org>]

end of thread, other threads:[~2002-07-24  0:25 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-16  0:52 access / freeing memory Jan Prazak
2002-07-15 22:22 ` tmoran
2002-07-16 13:54   ` Jan Prazak
2002-07-16 11:51     ` Fabien Garcia
2002-07-16 22:59       ` Jan Prazak
2002-07-16 15:42     ` Darren New
2002-07-16 22:59       ` Jan Prazak
2002-07-17  5:22         ` Simon Wright
2002-07-17 21:36           ` Jan Prazak
2002-07-24  0:25       ` David Thompson
2002-07-23  6:15   ` Kevin Cline
2002-07-18 18:22 ` chris.danx
2002-07-19 13:32   ` Jan Prazak
2002-07-19 23:50     ` chris.danx
     [not found] <mailman.1026804243.16337.comp.lang.ada@ada.eu.org>
2002-07-19  1:42 ` Robert A Duff

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