[PATCH 3/5] Move the memory allocation of entry buffers to a separate function

Linus Torvalds torvalds at linux-foundation.org
Thu Dec 27 14:20:58 PST 2012


On Thu, Dec 27, 2012 at 12:51 PM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>
> would it matter much if instead of storing the length and preserving the
> trailing white space, we fill the trailing white space with zeroes?

I'd prefer to avoid that. I don't know what libxml does with that
thing, and I'd hate to change the xml nodes.

> then the only thing that will be to needed is to allocate memory in
> utf8_string() and don't free the "buffer" in other parser functions.

I'd almost prefer just removing the whitespace games entirely then,
and letting the parsing functions do it. Most of them already handle
whitespace anyway, either explicitly  (parse_degrees()) or implicitly
(integer_or_float - thanks to strtoul() skipping it).

So the only thing that really wants the whitespace cleanup is probably
utf8_string(). We could just move it all there.

             Linus


More information about the subsurface mailing list