Re: Allocatable arrays in derived types
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Tue, 29 Apr 2008 02:26:48 -0700
relaxmike <michael.baudin@xxxxxxxxx> wrote:
I don't remember exactly where I read it on this forum,
but I remember that the difference between allocatable and pointer
arrays is that, when an allocatable array goes out of scope,
it is automatically deallocated.
That is *A* difference. It is certainly not *THE* difference.
This is the main reason for the overhead of a allocatable
array
No. That has pretty much nothing to do with it. Indeed, the size
overhead of an alocatable array is typically the same as that for a
pointer array.
there is also an additional bookkeeping
for the derived type itself ?
Not typically. There can be padding in some cases.
And what if one computes directly the size of the allocatable
array ? I expect it to be 1, but is that true ?
No. One would actiually have a bit of trouble computing such a thing (I
assume you mean the size of the descriptor or some such thing). If you
did, it would more likely be the same as that of the component. A single
integer is "clearly" insufficient to store the necessary data, which at
a minimum for a rank 1 array is the lower bound, size, and memory
location.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- Re: Allocatable arrays in derived types
- From: relaxmike
- Re: Allocatable arrays in derived types
- References:
- Allocatable arrays in derived types
- From: Gib Bogle
- Re: Allocatable arrays in derived types
- From: Arjen Markus
- Re: Allocatable arrays in derived types
- From: relaxmike
- Allocatable arrays in derived types
- Prev by Date: Re: Allocatable arrays in derived types
- Next by Date: Re: GUIs with Dislin -more examples
- Previous by thread: Re: Allocatable arrays in derived types
- Next by thread: Re: Allocatable arrays in derived types
- Index(es):
Relevant Pages
|
|