Re: getting offset of allocatable derived types



<hatingspam2009@xxxxxxxxx> wrote:

and find the offset between wdata(1) and wdata(2) this would give the
sizeof sensor_t. It appears that this does not work for allocatable
arrays as mentioned.

No, it works fine and does get you the size in question. I think you
don't yet understand that the problem is far more fundamental. It is not
just a matter of computing some size.

The actual data for the allocatable component is stored "elsewhere" in
memory. If you are trying to send an object with such a componen via
something like HDF or anything else that wants to send a contiguous
chunck of memory (i.e. anything that doesn't explicitly know details
about the implementation of the particular type in question), then it
isn't going to work at all. The size isn't the problem. The assumption
that all the data is contiguously stored in *ANY* size is the problem.

--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • memory leak in (?)... (redux)
    ... the mem leaks in our long-running tcl daemons. ... when actively exercised the app grows continuously. ... the mystery is that while our audit code does show us a couple of arrays ... and memory are checked and meanwhile externally, ...
    (comp.lang.tcl)
  • Re: StackOverflowException.
    ... The Status object monitors the ... so I'm really at a total loss as to where I'm leaking stack memory. ... private static extern bool EscapeCommFunction(IntPtr hFile, ... Good to know about arrays. ...
    (microsoft.public.dotnet.framework)
  • Re: Strategy for caches & GC
    ... I end up writing manual allocators for byte arrays. ... memory to insure it sits in the LOH and suballocate from there (ala ... ArraySlicehandle to work with buffers. ... and manual management for memory and GC generation 0 for efficient ...
    (microsoft.public.dotnet.framework.clr)
  • Re: How do I write directly to a memory address?
    ... unless you truly ARE out of memory, ... exception from cascading into the OS, ... something, arrays in particular, to throw out a message saying ... from a heavy math-background then the limitations {like the ...
    (comp.lang.ada)
  • Re: Allocatable versus automatic arrays
    ... but some of these arrays are only used conditionally.... ... it allocates a large chunk of memory ... this will make any difference in speed or memory management after the ... There can be more cost to declaring static arrays, ...
    (comp.lang.fortran)