[PATCH v3 2/6] Introduce new filtering architecture

Eugene Syromyatnikov evgsyr at gmail.com
Wed Jul 5 11:06:52 UTC 2017


On Wed, Jul 5, 2017 at 9:47 AM, Nikolay Marchuk
<marchuk.nikolay.a at gmail.com> wrote:
>>> +void
>>> +set_filters_qualify_mode(struct filter **filters, unsigned int *nfilters)
>>> +{
>>> +    unsigned int i;
>>> +    for (i = 0; i < *nfilters - 1; ++i) {
>>> +            free_filter(*filters + i);
>>> +    }
>>> +    **filters = (*filters)[*nfilters - 1];
>>> +    *filters = xreallocarray(*filters, 1, sizeof(struct filter));
>> I'm pretty sure realloc() can't be expected to be able to handle re-allocating
>> memory hunk which is provided by pointer not pointing at the beginning
>> of the hunk. IOW, allocators are not expected to work with arbitrary pointers,
>> only with ones that are returned by those allocators.
> But pointer isn't changed between allocations.
>>> +
>>> +DECL_FILTER_ACTION_PARSER(null);
>>> +DECL_FILTER_ACTION_PARSER(inject);
>>> +
>>> +#undef DECL_FILTER_ACTION_PARSER
>>> +
>>> +#define FILTER_ACTION_TYPE(NAME, PRIORITY, PARSER, PREFILTER)               \
>>> +{#NAME, sizeof(#NAME) - 1,PRIORITY, parse_ ## PARSER, free_ ## PARSER,      \
>>> + PREFILTER, apply_ ## NAME}
>> Missing indentation of the macro definition. Incorrect indentation of
>> the structure definition continuation.
> I can't find any references for multi-line structure definitions.
> What indentation should I use?
The default is single tab character, and I see no reason for using
something else in case of structure definition.


-- 
Eugene Syromyatnikov
mailto:evgsyr at gmail.com
xmpp:esyr at jabber.{ru|org}




More information about the Strace-devel mailing list