Re: allocatable array *not* equivalent to dynamic allocation?
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Wed, 31 May 2006 00:35:57 -0700
Craig Powers wrote:
(snip regarding reallocation)
As I understand it (not having looked at it lately), even the "normal" dynamic memory access of the C++ (1998) standard library uses this form of extending something. It's just that it gets buried under the hood of the standard templates, something that isn't so easy to do in F95.
With C, and I believe also C++, it can be done with at most one copy.
As I understand it, to do it in standard Fortran 90 or 95 requires two copies. Copy to a temporary array, deallocate and allocate a larger version of the original array, copy the data back, deallocate the temporary array.
-- glen
.
- Follow-Ups:
- Re: allocatable array *not* equivalent to dynamic allocation?
- From: David Frank
- Re: allocatable array *not* equivalent to dynamic allocation?
- References:
- allocatable array *not* equivalent to dynamic allocation?
- From: Lo
- Re: allocatable array *not* equivalent to dynamic allocation?
- From: Brooks Moses
- Re: allocatable array *not* equivalent to dynamic allocation?
- From: Craig Powers
- allocatable array *not* equivalent to dynamic allocation?
- Prev by Date: Re: Algorithm help for unique string searching/counting within an array.
- Next by Date: Re: Beginer needing help
- Previous by thread: Re: allocatable array *not* equivalent to dynamic allocation?
- Next by thread: Re: allocatable array *not* equivalent to dynamic allocation?
- Index(es):
Relevant Pages
|