Yep that's a precious resource. -----Original Message----- From: Maxim Uvarov [mailto:[email protected]] Sent: Tuesday, February 24, 2015 10:41 AM To: Robbie King (robking); [email protected] Subject: Re: [lng-odp] [PATCHv3 07/10] linux-generic: thread: add term_global
On 02/24/2015 06:18 PM, Robbie King (robking) wrote: > OK, cool. I removed the unnecessary set to zero. I always forget that we allocate memory for internal data structures with odp_shm_reserve(), which probably is not best way to go. For buffers pools it's ok but for different tables simple malloc() might be better because of platform implementation will not try to allocate memory from dma accessed memory. Maxim. > -----Original Message----- > From: Maxim Uvarov [mailto:[email protected]] > Sent: Tuesday, February 24, 2015 10:16 AM > To: Robbie King (robking); [email protected] > Subject: Re: [lng-odp] [PATCHv3 07/10] linux-generic: thread: add term_global > > On 02/24/2015 06:03 PM, Robbie King (robking) wrote: >> Hey Maxim, are you saying we should be setting this memory to zero >> immediately before we free it? To my knowledge we're not doing >> that any where else. > Ah, no no need to do this. Skip that comment. > > Maxim. > >>> + >>> + ret = odp_shm_free(odp_shm_lookup("odp_thread_globals")); >>> + if (ret < 0) >>> + ODP_ERR("shm free failed for odp_thread_globals"); >>> + >> memset(thread_globals, 0, sizeof(thread_globals_t)); >> is missing here. >> >> Maxim. >>> + return ret; >>> +} >>> + >>> >>> static int thread_id(void) >>> { >> _______________________________________________ >> lng-odp mailing list >> [email protected] >> http://lists.linaro.org/mailman/listinfo/lng-odp _______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
