summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-16 02:46:57 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-16 02:46:57 +0000
commita5b607c895adfb751c273e51fea101935d94e103 (patch)
tree38666e88965efee3788251c2c70c69f1f07b6b0a /regex.c
parent816779043d30d904d3c3aa32afae355d1d2569c9 (diff)
remove configure from repositry
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/regex.c b/regex.c
index 91fc1d9..2f9739a 100644
--- a/regex.c
+++ b/regex.c
@@ -70,13 +70,16 @@ void rb_trap_exec _((void));
# define CHECK_INTS if (!rb_prohibit_interrupt) {\
if (rb_trap_pending) rb_trap_exec();\
}
-#endif
-#ifndef xmalloc
+#define xmalloc ruby_xmalloc
+#define xcalloc ruby_xcalloc
+#define xrealloc ruby_xrealloc
+#define xfree ruby_xfree
+
void *xmalloc _((size_t));
void *xcalloc _((size_t,size_t));
void *xrealloc _((void*,size_t));
-void free _((void*));
+void xfree _((void*));
#endif
#define NO_ALLOCA /* try it out for now */
@@ -125,8 +128,8 @@ char *alloca();
#define FREE_VARIABLES()
-#define FREE_AND_RETURN_VOID(stackb) do { free(stackb); return; } while(0)
-#define FREE_AND_RETURN(stackb,val) do { free(stackb); return(val); } while(0)
+#define FREE_AND_RETURN_VOID(stackb) do { xfree(stackb); return; } while(0)
+#define FREE_AND_RETURN(stackb,val) do { xfree(stackb); return(val); } while(0)
#define DOUBLE_STACK(stackx,stackb,len,type) do { \
stackx = (type*)xrealloc(stackb, 2 * len * sizeof(type)); \
} while (0)
@@ -2410,18 +2413,18 @@ void
re_free_pattern(bufp)
struct re_pattern_buffer *bufp;
{
- free(bufp->buffer);
- free(bufp->fastmap);
- if (bufp->must_skip) free(bufp->must_skip);
-
- free(bufp->regstart);
- free(bufp->regend);
- free(bufp->old_regstart);
- free(bufp->old_regend);
- free(bufp->best_regstart);
- free(bufp->best_regend);
- free(bufp->reg_info);
- free(bufp);
+ xfree(bufp->buffer);
+ xfree(bufp->fastmap);
+ if (bufp->must_skip) xfree(bufp->must_skip);
+
+ xfree(bufp->regstart);
+ xfree(bufp->regend);
+ xfree(bufp->old_regstart);
+ xfree(bufp->old_regend);
+ xfree(bufp->best_regstart);
+ xfree(bufp->best_regend);
+ xfree(bufp->reg_info);
+ xfree(bufp);
}
/* Store a jump of the form <OPCODE> <relative address>.
@@ -4347,8 +4350,8 @@ re_free_registers(regs)
struct re_registers *regs;
{
if (regs->allocated == 0) return;
- if (regs->beg) free(regs->beg);
- if (regs->end) free(regs->end);
+ if (regs->beg) xfree(regs->beg);
+ if (regs->end) xfree(regs->end);
}
/* Functions for multi-byte support.