edje - cut another 120k or so off memory usage by using direct hash add
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sun, 21 Aug 2016 02:37:22 +0000 (11:37 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sun, 21 Aug 2016 02:37:22 +0000 (11:37 +0900)
so every collection we add to the eina has of collections... we just
did eina_hash_add - this isn't quite good. because we use eina_file
and mmap the edje file. we COULd use the strings straigh fromt he edje
filer dictionary and not actually allocate private heap memory - thus
sharing all those strings. this was silly, and this saves about
another 120k of memory with the default theme as it has about 1500 or
so collections in it... and these strings add up fast.

@optimize

src/lib/edje/edje_data.c

index 0541844..b9a0ee2 100644 (file)
@@ -647,7 +647,7 @@ _edje_eina_hash_add_alloc(Eina_Hash *hash,
    if (!hash)
      return NULL;
 
-   eina_hash_add(hash, key, data);
+   eina_hash_direct_add(hash, key, data);
    return hash;
 }