buildsystem, ide, ecere, ecs; (#906) added runtime option to ecere's memory manager...
authorJerome St-Louis <jerome@ecere.com>
Fri, 30 Aug 2013 05:28:57 +0000 (01:28 -0400)
committerJerome St-Louis <jerome@ecere.com>
Fri, 30 Aug 2013 05:45:11 +0000 (01:45 -0400)
compiler/ecs/ecs.ec
default.cf
ecere/src/com/instance.ec
ide/src/project/Project.ec
ide/src/project/Workspace.ec

index 2803b27..a509c9e 100644 (file)
@@ -9,6 +9,7 @@ import "ec"
 static define localeDir = "locale";
 static bool i18n;
 static bool outputPot;
+static bool disabledPooling;
 
 static Platform targetPlatform;
 static int targetBits;
@@ -473,9 +474,15 @@ static void WriteMain(char * fileName)
          f.Puts("   Property _property;\n");
       if(anyFunction)
          f.Puts("   GlobalFunction function;\n");
-      
+
       f.Puts("\n");
 
+      if(disabledPooling)
+      {
+         f.Puts("   eSystem_SetPoolingDisabled(true);\n");
+         f.Puts("\n");
+      }
+
       if(isDynamicLibrary)
       {
          f.Puts("   if(!__currentModule)\n");
@@ -1603,6 +1610,7 @@ class SymbolgenApp : Application
       char * output = null;
 
       outputPot = false;
+      disabledPooling = false;
       targetPlatform = GetRuntimePlatform();
       targetBits = GetHostBits();
 
@@ -1682,6 +1690,8 @@ class SymbolgenApp : Application
             }
             else if(!strcmp(arg, "-outputpot"))
                outputPot = true;
+            else if(!strcmp(arg, "-disabled-pooling"))
+               disabledPooling = true;
             else if(!strcmp(arg, "-console"))
                isConsole = true;
             else if(!strcmp(arg, "-dynamiclib"))
index a4a2058..38cda09 100644 (file)
@@ -16,7 +16,7 @@ export AR      = $(GCC_PREFIX)ar
 export STRIP   = $(GCC_PREFIX)strip
 export ECP := $(call sys_path,$(EC_BINS)ecp$(HOST_E))
 export ECC := $(call sys_path,$(EC_BINS)ecc$(HOST_E))$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)
-export ECS := $(call sys_path,$(EC_BINS)ecs$(HOST_E))$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)$(if $(OUTPUT_POT), -outputpot,)
+export ECS := $(call sys_path,$(EC_BINS)ecs$(HOST_E))$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)$(if $(OUTPUT_POT), -outputpot,)$(if $(DISABLED_POOLING), -disabled-pooling,)
 export EAR := $(call sys_path,$(_CF_DIR)obj/$(HOST_PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/bin/ear$(HOST_E))
 ifdef WINDOWS_TARGET
 WINDRES := $(GCC_PREFIX)windres
index d4bc741..8e7ecaa 100644 (file)
@@ -1184,7 +1184,7 @@ static void * _mymalloc(unsigned int size)
    {
       unsigned int p = SIZE_POSITION(size);
       if(!memoryInitialized) InitMemory();
-      if(p < NUM_POOLS)
+      if(!poolingDisabled && p < NUM_POOLS)
       {
          block = pools[p].Add();
          if(block)
@@ -6503,6 +6503,14 @@ public DesignerBase GetActiveDesigner()
    return activeDesigner;
 }
 
+
+bool poolingDisabled;
+
+public dllexport void eSystem_SetPoolingDisabled(bool disabled)
+{
+   poolingDisabled = disabled;
+}
+
 namespace sys;
 
 // constants
index 57fb4d7..a64a22d 100644 (file)
@@ -2147,7 +2147,7 @@ private:
       {
          char cfDir[MAX_LOCATION];
          GetIDECompilerConfigsDir(cfDir, true, true);
-         sprintf(command, "%s%s %sCF_DIR=\"%s\"%s%s%s%s%s COMPILER=%s %s-j%d %s%s%s -C \"%s\"%s -f \"%s\"",
+         sprintf(command, "%s%s %sCF_DIR=\"%s\"%s%s%s%s%s%s COMPILER=%s %s-j%d %s%s%s -C \"%s\"%s -f \"%s\"",
 #if defined(__WIN32__)
                "",
 #else
@@ -2160,6 +2160,7 @@ private:
                targetPlatform,
                bitDepth ? " ARCH=" : "",
                bitDepth == 32 ? "32" : bitDepth == 64 ? "64" : "",
+               ide.workspace.useValgrind ? " DISABLED_POOLING=1" : "",
                /*(bitDepth == 64 && compiler.targetPlatform == win32) ? " GCC_PREFIX=x86_64-w64-mingw32-" : (bitDepth == 32 && compiler.targetPlatform == win32) ? " GCC_PREFIX=i686-w64-mingw32-" :*/ "",
                compilerName, eC_Debug ? "--always-make " : "", numJobs,
                (compiler.ccacheEnabled && !eC_Debug) ? "CCACHE=y " : "",
@@ -2485,7 +2486,7 @@ private:
             f.Printf("CXX := $(CCACHE_COMPILE)$(DISTCC_COMPILE)$(GCC_PREFIX)%s$(_SYSROOT)\n", compiler.cxxCommand);
             f.Printf("ECP := $(if $(ECP_DEBUG),ide -debug-start \"$(ECERE_SDK_SRC)/compiler/ecp/ecp.epj\" -debug-work-dir \"${CURDIR}\" -@,%s)\n", compiler.ecpCommand);
             f.Printf("ECC := $(if $(ECC_DEBUG),ide -debug-start \"$(ECERE_SDK_SRC)/compiler/ecc/ecc.epj\" -debug-work-dir \"${CURDIR}\" -@,%s)$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)\n", compiler.eccCommand);
-            f.Printf("ECS := $(if $(ECS_DEBUG),ide -debug-start \"$(ECERE_SDK_SRC)/compiler/ecs/ecs.epj\" -debug-work-dir \"${CURDIR}\" -@,%s)$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)$(if $(OUTPUT_POT), -outputpot,)\n", compiler.ecsCommand);
+            f.Printf("ECS := $(if $(ECS_DEBUG),ide -debug-start \"$(ECERE_SDK_SRC)/compiler/ecs/ecs.epj\" -debug-work-dir \"${CURDIR}\" -@,%s)$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)$(if $(OUTPUT_POT), -outputpot,)$(if $(DISABLED_POOLING), -disabled-pooling,)\n", compiler.ecsCommand);
             f.Printf("EAR := %s\n", compiler.earCommand);
 
             f.Puts("AS := $(GCC_PREFIX)as\n");
index 98f9174..9e67fe6 100644 (file)
@@ -208,6 +208,7 @@ private:
    int vgRedzoneSize;
 
    vgRedzoneSize = -1;
+   vgLeakCheck = summary;
 
 public:
    void Save()