DragonFly BSD
DragonFly kernel List (threaded) for 2004-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: learning dragonfly or C...

From: "George Georgalis" <george@xxxxxxxxx>
Date: Thu, 11 Nov 2004 16:55:58 -0500

On Thu, Nov 11, 2004 at 12:18:51PM -0800, Matthew Dillon wrote:
>    Well, George... in fact I've already made precisely the optimization
>    you thought would clean up the code a few days ago.  It's part of my
>    VFS patchset.
>    Now is that a coincidence or not?

umm, none at all? I only noticed "struct vnode **vpp, *vp; vpp = &vp"
because I saw it removed by your vfsx22.patch and wanted to know what it
was about, thought I was clear about that.

>    Generally speaking, however, programmers do not make that sort of
>    unoptimized algorithm mistake very often, and you will find that most
>    of the other situations in the codebase where a double-indirect pointer
>    is used have to be coded the way they are coded.

Well that is a can of worms! I was curious why a pointer to a pointer
would ever be required but also want to keep focus on real code to not
get lost in the abstraction. (which is better C or C++, one has more
potential the other has more code)

The responses I read this morning where really amazing, not just really
fast. Thanks guys! there's a lot for me to go on there, I've got homework
cut out for me, for a while.

I've already compiled some notes and examples, have checked out doc,
with the intent of fitting the notes in the handbook or making a paper,
"Learning C with DragonFly".

I've gotten a little detoured with build problems on the doc module, but
I'll bring up those comments on the docs list. But, I would like to ask
here: Has anybody scripted up an index generator for XXX comments in
the code base? With people asking, every few days, how they can help, that
might be a good resource to have with daily doc builds (eg for site/mirror).

>    This brings up an interesting ancillary issue in that you might also
>    see a very experienced C programmer use a slightly different sort
>    of construction, like this:
>    struct vnode *vp;
>    struct vnode *nvp;
>    if ((error = ckpt_fhtovp(&vnh->vnh_fh, &nvp)) != 0)
>	    return error;
>    vp = nvp;
>    /* nvp ignored, vp used from here on */
>    Care to take a guess at why advanced C programmers use this construction
>    instead of simply passing &vp ?
>					-Matt

well not knowing what vnh_fh or ckpt_fhtovp is, sets me back a bit, but
I'll guess:

. ..need more info... 

is it a buffer to throw out illegal file handles inherited by NFS?

// George

George Georgalis, systems architect, administrator Linux BSD IXOYE
http://galis.org/george/ cell:646-331-2027 mailto:george@xxxxxxxxx

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