1 Oct 2006 08:07
Re: Status report: sysmon_cpufreq(9) + powerctl(8)
Juan RP <juan <at> xtrarom.org>
2006-10-01 06:07:14 GMT
2006-10-01 06:07:14 GMT
On Fri, 29 Sep 2006 20:53:38 +0100 (BST) Iain Hibbert <plunky <at> rya-online.net> wrote: > On Fri, 29 Sep 2006, Juan RP wrote: > > > Patch updated... I think I fixed all the things you said, please > > correct me if I'm missing something. > > When you create an object, you must release it when you dont want > it.. In sysmon_cpufreq_recv_data() there are some memory leaks. If > you add it to a dictionary (or array), the dictionary retains it but > you must also release it in any case. Ok... I still don't understand what functions retain the objects but I fixed most of them. > the sdict you return from sysmon_cpufreq_return_smcfdict() does also > not get released - maybe you dont really need to copy it? In fact, > I'm not sure why this function exists, you look for a key matching > drvn then do a prop_dictionary_get(dict, drvn) and return that object. Indeed! I removed the function and I search for the key in device_t properties dictionary. > in powerctl.c I dont think you need to make a copy of the dictionary > - it only exists in your process space, nobody else will touch it. > Also, you are releasing objects that you did not retain and not > releasing objects you created. True... I removed prop_dictionary_copy and now I use the object as(Continue reading)
RSS Feed