Konstantin Belousov <kostik...@gmail.com> writes:
> "Dag-Erling Smørgrav" <d...@des.no> writes:
> > +   otable = fdp->fd_ofiles;
> > +   ofileflags = fdp->fd_ofileflags;
> These two new calculations could be unused if the function return early.

I assume you mean assignments, not calculations.  I trust the compiler
to move them to where they are needed - a trivial optimization with SSA.

> > +   ntable = malloc(nnfiles * sizeof(*ntable) +
> > +       nnfiles * sizeof(*nfileflags) +
> > +       sizeof(struct freetable),
> >         M_FILEDESC, M_ZERO | M_WAITOK);
> Please use the horizontal space less lavishly.

I was aiming for readability, not compatibility with equipment that went
out of use before I was born.

> I think that this calculation, as well as fo calculation below, does
> not take a required alignment of struct freetable into consideration.

Correct, thanks for pointing it out.  The easiest solution is to place
the struct freetable between the file array and the flag array.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to