How about adding some comments? Of course I can but I hope someme who knows more about ths code can do this. Thanks.
Daniel Juyung Seo (SeoZ) On Fri, Jun 14, 2013 at 10:07 AM, Cedric BAIL <[email protected]> wrote: > On Fri, Jun 14, 2013 at 3:06 AM, Gustavo Sverzut Barbieri > <[email protected]> wrote: > > looks like it's on purpose... you just need to zero the list element > (next, > > prev, last), the payload (allocated memory to mp user) doesn't matter. > > Indeed. > > > On Thu, Jun 13, 2013 at 10:27 AM, Stefan Schmidt <[email protected] > >wrote: > >> Hello. > >> > >> Guess this goes mostly to Raster and Cedric. Or anyone else who feels > >> familiar with the eina mp one-big code. > >> > >> I had a "fix" sittign here for a some time where I never was sure if it > >> is correct or not. I somehow have the feeling that I missed some of the > >> code logic and this is actually all correct and how it should be. We > >> should add a coment in the code for this then. :) > >> > >> Specifically I talk about this: > >> > >> > http://git.enlightenment.org/core/efl.git/commit/?h=devs/stefan/eina-mp-fix&id=cdfceacb24f1b157d47beeb02933302248e388ad > >> > >> > >> retry_smaller: > >> eina_error_set(0); > >> - mem = malloc(sizeof(Eina_Inlist) + pool->item_size); > >> + mem = calloc(1, sizeof(Eina_Inlist) + pool->item_size); > >> if (!mem) > >> eina_error_set(EINA_ERROR_OUT_OF_MEMORY); > >> else > >> { > >> pool->over++; > >> - memset(mem, 0, sizeof(Eina_Inlist)); > >> pool->over_list = eina_inlist_append(pool->over_list, > >> (Eina_Inlist *)mem); > >> mem = ((unsigned char *)mem) + sizeof(Eina_Inlist); > >> > >> The memory allocated and assigned to mem is pool->item_size bigger than > >> the region we memset later. It that on purpose? For me it looks like an > >> oversight and the calloc should be better suited here. > >> > >> regards > >> Stefan Schmidt > >> > >> > >> > ------------------------------------------------------------------------------ > >> This SF.net email is sponsored by Windows: > >> > >> Build for Windows Store. > >> > >> http://p.sf.net/sfu/windows-dev2dev > >> _______________________________________________ > >> enlightenment-devel mailing list > >> [email protected] > >> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > >> > > > > > > > > -- > > Gustavo Sverzut Barbieri > > http://profusion.mobi embedded systems > > -------------------------------------- > > MSN: [email protected] > > Skype: gsbarbieri > > Mobile: +55 (19) 9225-2202 > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by Windows: > > > > Build for Windows Store. > > > > http://p.sf.net/sfu/windows-dev2dev > > _______________________________________________ > > enlightenment-devel mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > > > > > > -- > Cedric BAIL > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > enlightenment-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
