[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: heap and stack



"John Persing" <persing@frii.com> writes:

  I think you're getting too complicated. If you have the 'idl
  advanced development guide' of something like that, it has a
  discussion of what constitues an IDL variable. The 'Cliff Notes' on
  it is that the variable is a large descriptor with flags describing
  what the variable is, a Union allowing for the storage of scalars
  and the appropriately constructed structures allowing for the
  storage of dynamically allocated data structures. All variable types
  are accounted for, heap, pointer, object, array, structure and any
  kind of scalar. So there is no need a 'stack', 'temporary' or 'heap'
  variable. They're all just IDL_VARIABLES. Discrimination is made by
  virtue of the flags set within this descriptor.

  See the file $IDL_DIR/idl/external/export.h for the skinny on this.
  Look at the IDL_TYP_* macros, they define the type, and the
  IDL_ALLTYPES union, which stores that data of the variable.  You'll
  see there is a macro defined for pointers and object type variables
  and a flag for 'Heap' variable within the structure. The
  discrimination of whether a variable is temporary, constant, a file,
  a structure or dynamically allocated is made by querying the state
  of the IDL_VARIABLE 'flags' field.

  Still, having said all that, your explanation 'sounds' more 'expert' ;> 
  How are they to know?

William

> I will present a hypothesis, then a line of evidence, then I will wait for
> somebody else on the group to post a more sensible explanation.
> 
> Hypothesis:
> There are three type of variables:  stack variables, temporary variables,
> and heap variables.  (Plus a fourth type of abstraction of a "variable"
> which stores information about user-defined variable types like structures
> and objects, which we need not worry about here.)  All are of the same
> format:  a structure of metadata that includes a reference to the memory
> location of the first element of the data.  The three forms differ only in
> their metadata.
> 


(snip)

> --
>          }3 John Persing }3
>  http://www.frii.com/~persing   persing@frii.com
> Half of all Americans earn less than the median income!!!!!!


  Yes, but half earn more. I hope I'm one of them.


-- 
William Daffer: 818-354-0161: vapuser@catspaw.jpl.nasa.gov