Changeset d89da7c6 in OpenModelica
- Timestamp:
- 2016-04-05T12:35:18+02:00 (8 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- b500b84
- Parents:
- 8287b0b
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Compiler/runtime/Error_omc.cpp
r102e4da rd89da7c6 72 72 { 73 73 std::string res = ErrorImpl__printErrorsNoWarning(threadData); 74 return GC_strdup(res.c_str());74 return omc_alloc_interface.malloc_strdup(res.c_str()); 75 75 } 76 76 … … 78 78 { 79 79 std::string res = ErrorImpl__printMessagesStr(threadData,warningsAsErrors); 80 return GC_strdup(res.c_str());80 return omc_alloc_interface.malloc_strdup(res.c_str()); 81 81 } 82 82 -
Compiler/runtime/SimulationResultsCmp.c
r70d6f0e2 rd89da7c6 84 84 /* Copy the variable names from the MetaModelica list to the string array. */ 85 85 for(; MMC_NILHDR != MMC_GETHDR(vars); vars = MMC_CDR(vars)) { 86 cmpvars[i++] = GC_strdup(MMC_STRINGDATA(MMC_CAR(vars)));86 cmpvars[i++] = omc_alloc_interface.malloc_strdup(MMC_STRINGDATA(MMC_CAR(vars))); 87 87 } 88 88 -
Compiler/runtime/SimulationResultsCmpTubes.c
r70d6f0e2 rd89da7c6 801 801 fclose(fout); 802 802 if (isHtml) { 803 *htmlOut = GC_strdup(html);803 *htmlOut = omc_alloc_interface.malloc_strdup(html); 804 804 free(html); 805 805 } -
Compiler/runtime/System_omc.c
r5e18b052 rd89da7c6 205 205 extern const char* System_dirname(const char* str) 206 206 { 207 char *cpy = GC_strdup(str);207 char *cpy = omc_alloc_interface.malloc_strdup(str); 208 208 char *res = NULL; 209 209 #if defined(_MSC_VER) … … 319 319 char *s; 320 320 void *res = mmc_mk_nil(); 321 char *str = GC_strdup(str0);321 char *str = omc_alloc_interface.malloc_strdup(str0); 322 322 char *saveptr; 323 323 s=strtok_r(str,delimit,&saveptr); … … 396 396 void System_setClassnamesForSimulation(const char *class_names) 397 397 { 398 class_names_for_simulation = GC_strdup(class_names);398 class_names_for_simulation = omc_alloc_interface.malloc_strdup(class_names); 399 399 } 400 400 … … 728 728 MMC_THROW(); 729 729 } 730 return GC_strdup(buf);730 return omc_alloc_interface.malloc_strdup(buf); 731 731 } 732 732 -
Compiler/runtime/settingsimpl.c
r3fe15e26 rd89da7c6 119 119 exit(EXIT_FAILURE); 120 120 } else { 121 omhome = GC_strdup(info.dli_fname);121 omhome = omc_alloc_interface.malloc_strdup(info.dli_fname); 122 122 stripbinpath(omhome); 123 123 } … … 215 215 return ""; 216 216 } 217 return GC_strdup(homePath);217 return omc_alloc_interface.malloc_strdup(homePath); 218 218 } 219 219 … … 238 238 } else { 239 239 int lenHome = strlen(homePath); 240 buffer = (char*) GC_malloc_atomic(lenOmhome+lenHome+41);240 buffer = (char*) omc_alloc_interface.malloc_atomic(lenOmhome+lenHome+41); 241 241 snprintf(buffer,lenOmhome+lenHome+41,"%s/lib/omlibrary:%s/.openmodelica/libraries/",omhome,homePath); 242 242 } … … 248 248 /* adrpo: translate this to forward slashes! */ 249 249 /* duplicate the path */ 250 winLibPath = GC_strdup(path);250 winLibPath = omc_alloc_interface.malloc_strdup(path); 251 251 252 252 /* ?? not enough memory for duplication */ 253 253 if (!winLibPath) 254 return GC_strdup(path);254 return omc_alloc_interface.malloc_strdup(path); 255 255 256 256 /* convert \\ to / */ … … 263 263 #endif 264 264 265 return GC_strdup(path);265 return omc_alloc_interface.malloc_strdup(path); 266 266 } 267 267 -
Compiler/runtime/systemimpl.c
r5e18b052 rd89da7c6 234 234 extern int SystemImpl__setCCompiler(const char *str) 235 235 { 236 cc = GC_strdup(str);236 cc = omc_alloc_interface.malloc_strdup(str); 237 237 if (cc == NULL) return -1; 238 238 return 0; … … 241 241 extern int SystemImpl__setCXXCompiler(const char *str) 242 242 { 243 cxx = GC_strdup(str);243 cxx = omc_alloc_interface.malloc_strdup(str); 244 244 if (cxx == NULL) return -1; 245 245 return 0; … … 248 248 extern int SystemImpl__setLinker(const char *str) 249 249 { 250 linker = GC_strdup(str);250 linker = omc_alloc_interface.malloc_strdup(str); 251 251 if (linker == NULL) return -1; 252 252 return 0; … … 255 255 extern int SystemImpl__setCFlags(const char *str) 256 256 { 257 cflags = GC_strdup(str);257 cflags = omc_alloc_interface.malloc_strdup(str); 258 258 if (cflags == NULL) return -1; 259 259 return 0; … … 262 262 extern int SystemImpl__setLDFlags(const char *str) 263 263 { 264 ldflags = GC_strdup(str);264 ldflags = omc_alloc_interface.malloc_strdup(str); 265 265 if (ldflags == NULL) return -1; 266 266 return 0; … … 282 282 if (buf[i] == '\\') buf[i] = '/'; 283 283 } 284 return GC_strdup(buf);284 return omc_alloc_interface.malloc_strdup(buf); 285 285 #else 286 286 if (NULL == getcwd(buf,MAXPATHLEN)) { … … 288 288 return NULL; 289 289 } 290 return GC_strdup(buf);290 return omc_alloc_interface.malloc_strdup(buf); 291 291 #endif 292 292 } … … 684 684 } 685 685 686 char *res = GC_strdup(-1 == pclose(pipe) ? strerror(errno) : Print_getString(threadData));686 char *res = omc_alloc_interface.malloc_strdup(-1 == pclose(pipe) ? strerror(errno) : Print_getString(threadData)); 687 687 Print_restoreBuf(threadData, handle); 688 688 … … 995 995 { 996 996 /* basepath is finally found */ 997 pattern = GC_strdup(str);997 pattern = omc_alloc_interface.malloc_strdup(str); 998 998 break; 999 999 } … … 1009 1009 { 1010 1010 /* basepath is finally found */ 1011 pattern = GC_strdup(str);1011 pattern = omc_alloc_interface.malloc_strdup(str); 1012 1012 sub = res; 1013 1013 len_sub = strlen(sub); … … 1864 1864 } while (cont && ++i < MODELICAPATH_LEVELS); 1865 1865 if (*buf == ' ') buf++; 1866 *versionExtra = GC_strdup(buf);1866 *versionExtra = omc_alloc_interface.malloc_strdup(buf); 1867 1867 len = strlen(*versionExtra); 1868 1868 /* fprintf(stderr, "have len %ld versionExtra %s\n", len, *versionExtra); */ … … 1948 1948 continue; 1949 1949 res[i].dir = mp; 1950 res[i].file = GC_strdup(ent->d_name);1950 res[i].file = omc_alloc_interface.malloc_strdup(ent->d_name); 1951 1951 if (res[i].file[nlen] == ' ') { 1952 1952 splitVersion(res[i].file+nlen+1, res[i].version, &res[i].versionExtra); … … 2349 2349 if (!old_ctype_default) 2350 2350 old_ctype_default = "UTF-8"; 2351 char *old_ctype = GC_strdup(old_ctype_default);2351 char *old_ctype = omc_alloc_interface.malloc_strdup(old_ctype_default); 2352 2352 int old_ctype_is_utf8 = strcmp(nl_langinfo(CODESET), "UTF-8") == 0; 2353 2353 … … 2800 2800 char buf[64] = {0}; /* needs to be >=26 char */ 2801 2801 time_t t = (time_t) time; 2802 return GC_strdup(ctime_r(&t,buf));2802 return omc_alloc_interface.malloc_strdup(ctime_r(&t,buf)); 2803 2803 } 2804 2804 … … 3001 3001 *name = ""; 3002 3002 } else { 3003 *file = GC_strdup(info.dli_fname);3004 *name = GC_strdup(info.dli_sname);3003 *file = omc_alloc_interface.malloc_strdup(info.dli_fname); 3004 *name = omc_alloc_interface.malloc_strdup(info.dli_sname); 3005 3005 } 3006 3006 #endif -
SimulationRuntime/c/meta/gc/mmc_gc.h
r9b7aa44d rd89da7c6 113 113 /* for arrays only */ 114 114 static inline void* mmc_alloc_words_atomic_ignore_off_page(unsigned int nwords) { 115 #if defined(OMC_RECORD_ALLOC_WORDS) 116 mmc_record_alloc_words((nwords) * sizeof(void*)); 117 #endif 115 118 return GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE((nwords) * sizeof(void*)); 116 119 } … … 118 121 /* for arrays only */ 119 122 static inline void* mmc_alloc_words_ignore_off_page(unsigned int nwords) { 123 #if defined(OMC_RECORD_ALLOC_WORDS) 124 mmc_record_alloc_words((nwords) * sizeof(void*)); 125 #endif 120 126 return GC_MALLOC_IGNORE_OFF_PAGE((nwords) * sizeof(void*)); 121 127 }
Note: See TracChangeset
for help on using the changeset viewer.