HP3000-L Archives

June 1996, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stan Sieler <[log in to unmask]>
Reply To:
Stan Sieler <[log in to unmask]>
Date:
Tue, 11 Jun 1996 21:17:17 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (39 lines)
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

ATOM RSS1 RSS2