summaryrefslogtreecommitdiff
path: root/libguile/regex-posix.c
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2002-02-11 18:06:50 +0000
committerMarius Vollmer <mvo@zagadka.de>2002-02-11 18:06:50 +0000
commit4c9419ac31f8364db51ccf25f7f9d5d31dd412e7 (patch)
treeecce968212c4bda96b3531e61b9724ea93777cc7 /libguile/regex-posix.c
parentd013f095c14783c193385cb67d3778a1240cd19b (diff)
downloadguile-4c9419ac31f8364db51ccf25f7f9d5d31dd412e7.tar.gz
* gc.h, gc.c (scm_gc_sweep): Issue deprecation warning when
non-zero is returned from a port or smob free function. (scm_malloc, scm_realloc, scm_strndup, scm_strdup, scm_gc_register_collectable_memory, scm_gc_unregister_collectable_memory, scm_gc_malloc, scm_gc_realloc, scm_gc_free, scm_gc_strndup, scm_gc_strdup): New. * backtrace.c, continuations.c, convert.i.c, coop-threads.c, debug-malloc.c, dynl.c, environments.c, environments.h, extensions.c, filesys.c, fports.c, gc.c, gc.h, gh_data.c, goops.c, guardians.c, hooks.c, init.c, keywords.c, load.c, numbers.c, ports.c, posix.c, procs.c, rdelim.c, regex-posix.c, root.c, smob.c, stime.c, strings.c, struct.c, struct.h, symbols.c, unif.c, vectors.c, weaks.c: Use scm_gc_malloc/scm_malloc and scm_gc_free/free instead of scm_must_malloc and scm_must_free, as appropriate. Return zero from smob and port free functions. * debug-malloc.c (scm_malloc_reregister): Handle "old == NULL". * fports.c (scm_setvbuf): Reset read buffer to saved values when it is pointing to the putback buffer.
Diffstat (limited to 'libguile/regex-posix.c')
-rw-r--r--libguile/regex-posix.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libguile/regex-posix.c b/libguile/regex-posix.c
index 3d1ef561d..3eef85454 100644
--- a/libguile/regex-posix.c
+++ b/libguile/regex-posix.c
@@ -95,8 +95,8 @@ static size_t
regex_free (SCM obj)
{
regfree (SCM_RGX (obj));
- free (SCM_RGX (obj));
- return sizeof(regex_t);
+ scm_gc_free (SCM_RGX (obj), sizeof(regex_t), "regex");
+ return 0;
}
@@ -202,7 +202,7 @@ SCM_DEFINE (scm_make_regexp, "make-regexp", 1, 0, 1,
flag = SCM_CDR (flag);
}
- rx = SCM_MUST_MALLOC_TYPE (regex_t);
+ rx = scm_gc_malloc (sizeof(regex_t), "regex");
status = regcomp (rx, SCM_STRING_CHARS (pat),
/* Make sure they're not passing REG_NOSUB;
regexp-exec assumes we're getting match data. */
@@ -260,7 +260,7 @@ SCM_DEFINE (scm_regexp_exec, "regexp-exec", 2, 2, 0,
nmatches = SCM_RGX(rx)->re_nsub + 1;
SCM_DEFER_INTS;
- matches = SCM_MUST_MALLOC_TYPE_NUM (regmatch_t,nmatches);
+ matches = scm_malloc (sizeof (regmatch_t) * nmatches);
status = regexec (SCM_RGX (rx), SCM_STRING_CHARS (str) + offset,
nmatches, matches,
SCM_INUM (flags));
@@ -279,7 +279,7 @@ SCM_DEFINE (scm_regexp_exec, "regexp-exec", 2, 2, 0,
= scm_cons (scm_long2num (matches[i].rm_so + offset),
scm_long2num (matches[i].rm_eo + offset));
}
- scm_must_free ((char *) matches);
+ free (matches);
SCM_ALLOW_INTS;
if (status != 0 && status != REG_NOMATCH)