Re: memory management



Robert A Duff wrote:

> alex goldman <hello@xxxxxxxx> writes:
>
>> As I understood from reading the Ada tutorial for C/C++ programmers,
>> "access" is essentially like C++ smart pointer,
>
> No, Ada access types are just pointers -- no "smarts".
> To make something like smart pointers, you can use
> controlled types.

No again - any paricular Ada implementation is free to implement access
types as they see fit. With GNAT an access may consist of an pointer to the
data and a pointer to a dope vector:

http://en.wikipedia.org/wiki/Dope_vector

Remeber that an Ada compiler may also implement garbage collection.

Martin
--
mailto://krischik@xxxxxxxxxxxxxxxxxxxxx
Ada programming at: http://ada.krischik.com

.



Relevant Pages

  • Ada access vs C/C++ pointers and references
    ... In the "ADA Popularity Discussion Request" thread, ... of C/C++ pointers and Ada access types came up. ... It seems to me that Ada access types are more akin to C++ ... above, pointer arithmetic is partly ...
    (comp.lang.ada)
  • Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada)
    ... > in Ada. ... > it at hand anyway, but the gist of it is that, in Ada, loop variables ... I would expect a programmer to know the precedence ... > * pointer types cannot be converted to one another. ...
    (comp.lang.ada)
  • Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada)
    ... > in Ada. ... > it at hand anyway, but the gist of it is that, in Ada, loop variables ... I would expect a programmer to know the precedence ... > * pointer types cannot be converted to one another. ...
    (comp.lang.cpp)
  • Re: Ada Pointer Problem
    ... > Ada as a Second Language has a whole chapter describing access ... inability to find a 'pointer'. ... If I used a brass hammer I would be required to ...
    (comp.lang.ada)
  • Re: ADA Popularity Discussion Request
    ... > Theoretically Ada has better support for optimizations than C. ... This assumes that compiler is ... In Ada an object has to be ... In C99 you can declare a pointer 'restrict' meaning the compiler may ...
    (comp.lang.ada)