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, ...
  • 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. ...
  • 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 ...
  • 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 ...
  • Re: perl eating up memory slowly until program stops - any ideas ?
    ... Arrays are created, variables are set, ... For lexical scoping, a single chunk of memory, reserved by ... Private blocks, you have discussed this a number of times ...