"James Giles" <[log in to unmask]> wrote:
...
> > The difference is because DEALLOCATE, unlike "free", knows the
> > data type of the thing it is deallocating - and thus the (scalar) size.
>
> Actually, DEALLOCATE doesn't know the size unless the
> size has been saved somewhere. It can only magically
> know it without saving somewhere if the size is a
> compile-time constant (even then, it's stored wherever
> such constants reside - possibly as an immediate value
> in an instruction). Since the size has to be saved somewhere,
> it might as well be part of the allocated data.
Sorry, I missed the fact that this discussion was about scalar
allocations and not arrays. I thought I canceled this message
anyway - guess I missed it.
However, is there really that much problem with a little extra
overhead in allocating scalars? How many scalars can you
allocate before you decide you'd be better off using arrays
anyway?
--
J. Giles
|