Markus Mottl avatar Markus Mottl committed 946475d

Replaced calls to malloc to caml_stat_alloc

Comments (0)

Files changed (1)

 CAMLprim value pcre_set_imp_match_limit_stub(value v_rex, value v_lim){
   pcre_extra *extra = (pcre_extra *) Field(v_rex, 2);
   if (extra == NULL) {
-    extra = pcre_malloc(sizeof(pcre_extra));
+    extra = caml_stat_alloc(sizeof(pcre_extra));
     extra->flags = PCRE_EXTRA_MATCH_LIMIT;
     Field(v_rex, 2) = (value) extra;
   }
     else {
       value v_cof = Field(v_maybe_cof, 0);
       value v_substrings;
-      char *subj = malloc(sizeof(char) * len);
-      int *ovec = malloc(sizeof(int) * subgroups3);
+      char *subj = caml_stat_alloc(sizeof(char) * len);
+      int *ovec = caml_stat_alloc(sizeof(int) * subgroups3);
       int ret;
       struct cod cod = { (value *) NULL, (value *) NULL, (value) NULL };
       struct pcre_extra new_extra = { PCRE_EXTRA_CALLOUT_DATA, NULL, 0, NULL };
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.