stefan pushed a commit to branch master.

commit 64c7bd14df859791522482fea6a5893b67ddc33e
Author: Stefan Schmidt <[email protected]>
Date:   Fri Jun 14 09:56:55 2013 +0100

    eina/mp/one_big: Add a comment to clarify why we do not memset the complete 
memory.
    
    To avoid people getting confused over this code, like myself, add a comment
    to clarify that only the elements need to be set to zero while the payload
    does not matter here.
---
 src/modules/eina/mp/one_big/eina_one_big.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/modules/eina/mp/one_big/eina_one_big.c 
b/src/modules/eina/mp/one_big/eina_one_big.c
index 2fbd759..e658013 100644
--- a/src/modules/eina/mp/one_big/eina_one_big.c
+++ b/src/modules/eina/mp/one_big/eina_one_big.c
@@ -125,6 +125,7 @@ eina_one_big_malloc(void *data, EINA_UNUSED unsigned int 
size)
    else
      {
         pool->over++;
+        /* Only need to zero list elements and not the payload here */
         memset(mem, 0, sizeof(Eina_Inlist));
         pool->over_list = eina_inlist_append(pool->over_list, 
                                              (Eina_Inlist *)mem);

-- 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Reply via email to