This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] gconv: Replace norm_add_slashes with __gconv_norm_add_slashes
- From: Florian Weimer <fweimer at redhat dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 20 Jun 2017 00:17:06 +0200
- Subject: Re: [PATCH] gconv: Replace norm_add_slashes with __gconv_norm_add_slashes
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C265BC04B31F
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C265BC04B31F
- References: <20170619161703.C2225402AEC3C@oldenburg.str.redhat.com> <07ccf6fc-038f-4e11-3417-e6e9cddfd0a5@linaro.org>
On 06/19/2017 11:38 PM, Adhemerval Zanella wrote:
> I think this is a good candidate for char_array usage [1]:
>
> #define CHAR_ARRAY_INITIAL_SIZE 0
> #include <malloc/char_array-skeleton.c>
> […]
Hmm, I'll review your latest char_array patch, then. But if we have
multiple users, we should think about out-lining more of the code.
I believe Arjun may also need a variant of this function
(norm_add_slashes) for his iconv -c fix.
>> + if (charset == NULL || outcharset == NULL)
>> + {
>> + free ((char *) encoding);
>
> No need to cast on free.
encoding is a const char *.
> In fact these seems another place where a char_array could find some use
> to avoid all the boilerplate of managing buffers size to appendages and
> buffer management (and we could get some speed up by using the stack as
> well).
But we can realistically make such far-reaching changes only after
eliminating the conditional compilation, and that's not something I want
to do in this patch.
Thanks,
Florian