On Sat, Feb 17, 2001 at 12:22:44PM +0000, Nicholas Clark wrote:
> > Very, very, very rough example so you get the idea:
> [reassuring example]
Here's a slightly less rough example. Pipe the following code to
the attached Perl program, and look at the output on stdout, and in
vtable.h:
CLASS=sviv METHOD=new
if (pmc)
(pmc->vtbl->destroy)(pmc);
else
pmc = (PMC)malloc(sizeof(PMC));
pmc->vtbl = &sviv_vtable;
pmc->private_data = (IV*)malloc(sizeof(IV*));
return pmc;
--
"Even had to open up the case and gaze upon the hallowed peace that
graced the helpdesk that day." -- Megahal (trained on asr), 1998-11-06
vtable.pl