comp.lang.ada
 help / color / mirror / Atom feed
* dynamic allocation
@ 1995-04-03  0:00 Jonas Nygren
  1995-04-03  0:00 ` Samuel Tardieu
  1995-04-04  0:00 ` Niklas Holsti
  0 siblings, 2 replies; 4+ messages in thread
From: Jonas Nygren @ 1995-04-03  0:00 UTC (permalink / raw)



Some short questions:

Does Ada95 have dynamic memory allocation/deallocation primitives builtin
to the language - cf. C++'s new and delete?

Does Ada95 have functionality comparable with C++'s constructors and destructors?

Does Ada95 support garbage collection?

thanks in advance

/jonas





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

* Re: dynamic allocation
  1995-04-03  0:00 dynamic allocation Jonas Nygren
@ 1995-04-03  0:00 ` Samuel Tardieu
  1995-04-04  0:00 ` Niklas Holsti
  1 sibling, 0 replies; 4+ messages in thread
From: Samuel Tardieu @ 1995-04-03  0:00 UTC (permalink / raw)
  To: Jonas Nygren

>>>>> "Jonas" == Jonas Nygren <ehsjony@ehs.ericsson.se> writes:

 Jonas> Some short questions:

Some short answers.

 Jonas> Does Ada95 have dynamic memory allocation/deallocation
 Jonas> primitives builtin to the language - cf. C++'s new and delete?

Yes it does. They are called 'new' and 'Unchecked_Dellocation'.

 Jonas> Does Ada95 have functionality comparable with C++'s
 Jonas> constructors and destructors?

Yes it does. You have to make your objects child of 'Controlled' or
'Limited_Controlled'.

 Jonas> Does Ada95 support garbage collection?

Ada95 is allowed to do garbage collection, but I think that's not
mandatory.

  Sam
--
"La cervelle des petits enfants, ca doit avoir comme un petit gout de noisette"
                                                       Charles Baudelaire




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

* Re: dynamic allocation
  1995-04-03  0:00 dynamic allocation Jonas Nygren
  1995-04-03  0:00 ` Samuel Tardieu
@ 1995-04-04  0:00 ` Niklas Holsti
  1 sibling, 0 replies; 4+ messages in thread
From: Niklas Holsti @ 1995-04-04  0:00 UTC (permalink / raw)


In <3loml4$98v@erinews.ericsson.se> ehsjony@ehs.ericsson.se (Jonas Nygren) writes:


>Some short questions:

>Does Ada95 have dynamic memory allocation/deallocation primitives builtin
>to the language - cf. C++'s new and delete?

Yes, "new" and "unchecked_deallocation". Don't be scared by the name of
the latter, it's safer than the "delete" in C++. Ada 83 has these also.

>Does Ada95 have functionality comparable with C++'s constructors and
>destructors?

Yes, default initialization and finalization for Controlled types.
This is new with Ada 95.

>Does Ada95 support garbage collection?

Automatic garbage collection is allowed in both Ada 83 and Ada 95, but
no known compilers do it.  Both Ada 83 and 95 can collect the memory
used by dynamically allocated objects of a type when the type goes out
of scope.  So if in a subprogram you define a local type, the
dynamically allocated objects of that type may be collected when the
subprogram returns.  I think this is implementation dependent, however. 
Ada 95 gives you more control over the storage pools. 

>thanks in advance

>/jonas

Hope to have helped,
- Niklas

--
Niklas Holsti                         
    Space Systems Finland Ltd, phone +358 0 4354 3928
    Tekniikantie 12, P.O. Box 324, FIN-02151 Espoo, Finland




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

* dynamic allocation
@ 2004-08-27 19:49 tmoran
  0 siblings, 0 replies; 4+ messages in thread
From: tmoran @ 2004-08-27 19:49 UTC (permalink / raw)


"during testing, an exception was made"

From ACM Tech News:

>"NASA: DOS Glitch Nearly Killed Mars Rover"
>Extreme Tech (08/23/04); Hachman, Mark
>
>NASA scientist Robert Denise said at this week's Hot Chips conference that
>the real cause of a glitch on the Mars Spirit rover early this year was
>not corruption in the flash memory, but rather an embedded DOS file system
>that grew out of control.  An undisclosed software vendor had required the
>flash memory that stored the directory structure in RAM, which was only
>half the size of the flash memory and eventually ran out of space.  In
>addition, there was only 128 MB of DRAM compared to 256 MB of flash
>memory, virtually guaranteeing an eventual crash.  The problem with the
>file system was that the DOS directory structure was stored as a file that
>did not reduce in size even when files were deleted from the directory
>tree, since special characters indicated where new data could come in.
>While that aspect alone was not dangerous, the Wind River embedded OS used
>a piece of third-party software that required the mirroring of flash
>memory in RAM.  Denise admitted that during testing, an exception was made
>for the dynamic allocation feature, which is usually not allowed in
>embedded systems.  When the system finally generated a memory allocation
>command to a nonexistent memory address, it crashed.  The error did not
>manifest itself until Jan. 21, when Spirit fell into a continuous reboot
>cycle and could not transmit data through its antenna.  After five days,
>NASA Jet Propulsion Laboratory's Flight Software Development Team solved
>the problem by using system RAM as simulated flash and then isolating the
>error.  After flash memory was erased, the NASA team installed a
>file-system monitoring utility that tracked memory as a consumable resource.



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

end of thread, other threads:[~2004-08-27 19:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-04-03  0:00 dynamic allocation Jonas Nygren
1995-04-03  0:00 ` Samuel Tardieu
1995-04-04  0:00 ` Niklas Holsti
  -- strict thread matches above, loose matches on Subject: below --
2004-08-27 19:49 tmoran

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