I will see how to improve this part.
Thanks Charles 2016-07-29 1:00 GMT-07:00 Christos Zoulas <chris...@astron.com>: > In article <CA+SXE9tdKyLz-YsS8Gu=dP79jwarxj5Fx1E2KcqomM= > ryem...@mail.gmail.com>, > Charles Cui <charles.cui1...@gmail.com> wrote: > > >> yes, but where does the ksiginfo get freed now since you removed: > >> - ksiginfo_free(ksi); /* XXXSMP */ > >> > >well, the original logic only finds one target signal and return true, at > >that time ksi is pointing to some data, > >in my case, I need to loop all signals to return the count, and at the end > >of the loop, ksi is set to be NULL. > > Ok, there are multiple ksi entries for the same signal in the loop. Each > invocation returns the count of them and pops the first one and returns > the count. Setting it to NULL does not free the data, you need to free > the data for the ksiginfo you freed. If you keep running the code you > should see signal memory accumulate. > > christos > >