raster pushed a commit to branch master.

commit fb3159c48eaca7589b5e38a30b60ea12e8f41f2e
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Thu Aug 8 20:18:08 2013 +0900

    eina module - minor addition ot allowing lazy loading if env var set
---
 src/lib/eina/eina_module.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/lib/eina/eina_module.c b/src/lib/eina/eina_module.c
index 7731b3d..9289f71 100644
--- a/src/lib/eina/eina_module.c
+++ b/src/lib/eina/eina_module.c
@@ -306,6 +306,7 @@ EAPI Eina_Bool eina_module_load(Eina_Module *m)
 #ifdef HAVE_DLOPEN
    void *dl_handle;
    Eina_Module_Init *initcall;
+   int flag = RTLD_NOW;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(m, EINA_FALSE);
 
@@ -314,10 +315,12 @@ EAPI Eina_Bool eina_module_load(Eina_Module *m)
    if (m->handle)
       goto loaded;
 
-   dl_handle = dlopen(m->file, RTLD_NOW);
+   if (getenv("EINA_MODULE_LAZY_LOAD")) flag = RTLD_LAZY;
+   dl_handle = dlopen(m->file, flag);
    if (!dl_handle)
      {
-        WRN("could not dlopen(\"%s\", RTLD_NOW): %s", m->file, dlerror());
+        WRN("could not dlopen(\"%s\", %s): %s", m->file, dlerror(), 
+            (flag == RTLD_NOW) ? "RTLD_NOW" : "RTLD_LAZY");
         eina_error_set(EINA_ERROR_WRONG_MODULE);
         return EINA_FALSE;
      }

-- 

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

Reply via email to