[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: struct variable definition (in var.h)

From: John Darrington
Subject: Re: struct variable definition (in var.h)
Date: Mon, 8 Nov 2004 17:44:30 +0800
User-agent: Mutt/1.3.28i

On Sun, Nov 07, 2004 at 11:15:32PM -0800, Ben Pfaff wrote:
     It's fine with me.  I've been unhappy with this approach for a
     long time, and it'd be great to get rid of that ugly union.  The
     only reason I didn't change it was that I didn't have an idea I
     was really happy with.  What's the plan?

There are several `plans' in the back of my mind.  I've yet to
seriously think through their relative merits:

1.  Forget the whole thing.  Just let each command allocate the data
    it needs on the heap, and keep track of what variable it belongs

2.  Have a generic (void *) pointer instead of the union.  Commands
    will still be required to allocate and deallocate the memory, but
    the pointer keeps track of the variable to which they refer.

3.  As above, but have each command register a function to allocate
    and de-allocate the memory.  Some lower level of PSPP (which I'll
    call the `allocator') will call these functions as appropriate. 
    The allocator will need to provide an interface which commands
    will use to declare which variables are of interest.

No 3 requires more work to begin with, but will probably pay off as
more commands are added (provided I get the model sufficiently general
to cater for most of the commands).  This option also provides the
opportunity for statistics to be persisted between commands.

I might be able to work this in with the optimisation framework I'm
doing.  As always however, the question is how much investment should
we be prepared to put in before getting a return.   Hopefully I'll be
able to come up with  a reasonable compromise.


PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See or any PGP keyserver for public key.

Attachment: pgpwhymdfyzAa.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]