Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!hsdndev!husc6!encore!encore.UUCP From: soper@encore.UUCP (Pete Soper,Cary NC,9194813730,9193624635) Newsgroups: comp.lang.modula2 Subject: Re: How to write NEW? Message-ID: <14620@encore.Encore.COM> Date: 22 Apr 91 01:22:14 GMT References: <5122672@janhh.hanse.de> Sender: news@Encore.COM Lines: 16 Nntp-Posting-Host: maxzilla.encore.com From article <5122672@janhh.hanse.de>, by jan@janhh.hanse.de (Jan Willamowius): [description of "new" implementation omitted] > The problem is that p 'looses' its type in the conversion to ADDRESS and > only a WORD is Allocated (ADDRESS is POINTER TO WORD). > > Any ideas ? If you have the source to your compiler, yes, otherwise no. The problem is that at the point "new" is invoked, the compiler needs to pass the size of the item to be allocated as a hidden parameter. So if you can modify your compiler you can arrange for new to be an intrinsic and pass the size along. Otherwise you are out of Shlitz. Without changing the compiler you *must* add a second parameter to new to pass the item size. ----------------------------------------------------------------------- Pete Soper (soper@encore.com) +1 919 481 3730 Encore Computer Corp, 901 Kildaire Farm Rd, bldg D, Cary, NC 27511 USA