On Fri, Dec 12 2014, Jason Ekstrand wrote:
> Should be MAX2(blob->allocated * 2, blob->size + additional)

Yikes! Yes. That's really embarrassing.

> Something to tuck in the back of your brain in case you have a need to grow
> this datastructure: The above write functions could be generated with three
> invocations of a macro that takes a function name and a type.  That would
> prevent copy-and-paste typos.  For only 3 functions, this probably isn't
> worth it.

An excellent point. And before I sent this out the first time, I
actually sat down to re-write it exactly that way. And just as you
mention here, when I saw that it's only the three read functions that
benefit, (read_string() is special), I decided it's more
readable/maintainable in its current form. But yes, if it grows any, we
can definitely do that. So I can at least capture that idea in a
comment.

> Other than the couple comments here and the alignment thing (different
> e-mail).
>
> Reviewed-by: Jason Ekstrand <jason.ekstr...@intel.com>

Thanks. I'll catch the missing mention of blob.h in Makefile.sources as
Matt pointed out as well.

And like I said, I think I will just hold onto this patch until landing
some code that uses it. (It's not like there's going to be any
difficulty rebasing it across future changes to Mesa.)

-Carl

PS. Aside from Gmail's whacky quoting/wrapping, would it be easy for you
to omit from code-review emails the parts of the code that you're not
replying to? I'm nervous that I might miss some useful comment when I'm
cutting those pieces out of my replies. Thanks.

Attachment: pgphYaqwkse5v.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to