Subject: | |
From: | |
Reply To: | |
Date: | Tue, 11 Jun 1996 21:17:17 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Gavin gave the basic answer, but...a little more...
If "p64" is pointer of type: ^ $extnaddr$ foo,
*AND* it really, most sincerely points into *YOUR* heap,
at the start of a block of memory allocated by *YOUR* process (via
a call to "new"), then you can free it via either of:
var p32 : ^ foo;
p32 := p64; {this will cause a compiler note/warning about}
{emitting bounds/range checking (I think). }
dispose (p32);
or, maybe,
type
p32_ptr_type = ^ foo;
dispose (p32_ptr_type (localanyptr (p64));
I haven't tried either, and wouldn't be too surprised if the second
won't compile.
BTW, the one of the Pascal manuals points out (somewhere) that dispose()
isn't useful unless you've compiled with some option like $HEAPDISPOSE ON$
(or something like that...sorry I don't recall for sure, but I don't
have the manuals handy, and scanning 185,745 lines of my own Pascal source
shows not a single instance of new or dispose, so I can't check an example.
--
Stan Sieler [log in to unmask]
http://www.allegro.com/sieler.html
|
|
|