On Wed, Jan 16, 2013 at 9:36 AM, Carsten Haitzler <[email protected]> wrote: > On Wed, 9 Jan 2013 10:11:37 +0900 Cedric BAIL <[email protected]> said: > >> Yop, >> >> On Wed, Jan 9, 2013 at 7:13 AM, Gustavo Sverzut Barbieri >> <[email protected]> wrote: >> > Quick review: >> > >> > - Eina_Cow_Ptr should be before given memory to user. >> > - It would enforce alignment (as user memory could be not aligned). >> > Eina_Cow_Ptr itself is always aligned because it contains pointers, so it >> > will not impact what follows. >> >> Eina_Cow_Ptr doesn't have a pointer in it. >> >> > - It would be less likely to suffer from out-of-bounds writes... that >> > are VERY common bug :-P >> > - Please use a macro to get Eina_Cow_Ptr from memory. >> >> Indeed. >> >> > - Eina_Cow_Ptr should have magic header... will consume more memory, but >> > it's a valuable way to avoid errors with users giving invalid pointers >> >> Hum, as Eina_Magic can be disable. Sounds good to. Does the release >> profile disable Eina_Magic, btw ? > > it'd be fine if: > > 1. its separately disableable compared to object magics... so ucan keep object > magic no's and disable cow magics > 2. we need eo id's with special memory space allocation of eo object data > outside of normal malloc space so the chances of a memory override/scribble > over another object are nigh 0. at this point magic numbers become moot as the > object id/table pretty much replace the need safely...
The problem is that this API is not private to eo, evas or edje. It's in eina, with a fancy name... then people start to use it and problems will show. Again, the same problems I listed for eo: we need to handle the bad/wrong cases when we think about an API. This COW API is bad as I've listed in many places in this thread. I'll just shut up as I'm not being listed, but at least I've replied to a more "official" media... last time I've complained to people at IRC and eo problems leaked and we're suffering now... yet people said "nobody complained". This time I'm complaining, the eina_cow is error prone and confusing/misleading in its method names (ie: the memset). -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -------------------------------------- MSN: [email protected] Skype: gsbarbieri Mobile: +55 (19) 9225-2202 ------------------------------------------------------------------------------ Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
