[collectd] [PATCH] src/csv.c: use a bigger buffer
Colin McCabe
cmccabe at alumni.cmu.edu
Wed Jul 27 19:02:38 CEST 2011
On Wed, Jul 27, 2011 at 4:37 AM, Florian Forster <octo at collectd.org> wrote:
> Hi Colin,
>
> thank you very much for your patch!
>
> On Mon, Jul 25, 2011 at 05:00:07PM -0700, Colin McCabe wrote:
>> - char values[512];
>> + char *values = NULL;
>
> Why don't use stick with stack memory here? Allocating a (fixed sized)
> junk on the heap only means that you'll have to free it again.
Yeah, I guess I could put that 4k on the stack.
Thanks for taking a look at this!
regards,
Colin McCabe
>
>> - return (-1);
>> + goto fail;
>
> Sorry, but "goto" is a no-go for collectd. You can use something like
> "do { … } while (0);" if you must, but in this particular case I think
> simply using stack memory is the way to go.
>
> Best regards,
> —octo
> --
> Florian octo Forster
> Hacker in training
> GnuPG: 0x0C705A15
> http://octo.it/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iQIcBAEBAgAGBQJOL/iCAAoJEMPSHpbi2Mmg1pwQAJwjvRyZbIkJjjWUiZL43/Mm
> TTxnJyqO5rB4crMDxFya4ccDJ0PH1N6UnvUNdZmAlSgUUwzNMH7fw8vElFaJJjMq
> +vGPAclZ30k+kAC1/W8pudv1JqqrytLCkX0ZIyBn8Vd7gl+qis7bRNVT1cbihdaU
> 2fByebX2Qb9+45P2zOipqpL5LLjoY8G3WZV7/3RYb4ErtRB1YT9fMC6PJrjzXwS3
> NstKPdJTA26B4TlJ3Ij9MDdnukn9nfD7uL0Iqxv5aG9zHNP6QOtd5L3bV+ZSlXIA
> b/Jlo+EJGl/xsjw8RNSOMp+vJkCiwbS2x+jg51MZdKITLofaAomGKtV0V1lA5rw2
> FGDliXPvUmOr/Pb8S8qs+AMUVafb4pOyz7+5P/qxMkDR/4tzCnQ8/X4syRqViD5m
> twU6BDdY26CqnUWRZlfKf/Pg7JzDrW1qkjwf1t2NbTCjSJ73ojo35LGBDSN95XLy
> FKxkdpEedmXo5zKPtVXtQVglZlJqjPkZ72b/S4rOcNxKHSd1pO9aHTbzq8P3YiFt
> Mx1LWij48Rq+LsUM5RDcPKj937YjdrnaRwDzFohLn/y6uwVV4eVpfg1ft2QmAXrN
> okVEnACYb64P9Ar3PSr7u+USnP8tOUdzDYUXYQQ9+IpHo6yyODvOOkmxX4Wm7azo
> b9SHMDqUBZ2aBZEXMKQj
> =w1Z2
> -----END PGP SIGNATURE-----
>
>
More information about the collectd
mailing list