chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH(5)] Add allocation size helpers C_SIZEOF_ST


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH(5)] Add allocation size helpers C_SIZEOF_STRUCT and C_SIZEOF_CLOSURE
Date: Sat, 13 Sep 2014 23:55:24 +0200
User-agent: Mutt/1.4.2.3i

On Sat, Sep 13, 2014 at 11:30:20PM +0200, Felix Winkelmann wrote:
> Ok. The former really allocates a slot too much, but that makes no
> difference besides wasting a word in the nursery.

Not too much of a problem, but it would increase the minor GC frequency,
even if by a little bit.

> The latter used to
> intern "##sys#interrupt-hook" on the fly once, IIRC. So the comment is
> indeed wrong.

Ah, excellent.  I was wondering about that :)

> > So in the end I decided that it's probably the simplest to just keep
> > things the way they are, and use the "low level" slot size as the
> > interface everywhere.  I've added this to the "C interface" document.
> 
> Very good, thanks for doing this.

No prob, I'm glad to make things just a little user-friendlier :)

> > More confusing things: It's called STRUCT(URE) everywhere, but the
> > constructors are called C_a_i_record[N].  The C_closure() function
> > accepts the slot count, including the function pointer but it has
> > the function pointer as a separate argument. 
> 
> It's the first argument. What qualifies it as "separate"?

It's explicitly listed in the prototype, instead of being among the
varargs.

> > The C_record()/C_structure
> > only accept a count and have the tag as part of the rest arg.  The
> > C_make_structure() function, however, has the type as an explicit
> > argument with only the slots as varargs.
> 
> Are you complaining about the C function prototypes, then?

Right.

> > Not sure if we should fix these now, but they sure are confusing.
> 
> Nah... it's all wonderfully consistent! :-)

I expect nothing less!  CHICKEN is a human-readable paragon of software
development brilliance, after all.

Cheers,
Peter
-- 
http://www.more-magic.net



reply via email to

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