diff options
author | Bryce McKinlay <bryce@waitaki.otago.ac.nz> | 2002-02-12 04:37:57 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2002-02-12 04:37:57 +0000 |
commit | 79f777fd1e10435cb50c4b45a664bd6ae280f2c1 (patch) | |
tree | cef3197531d988920cbff060bdc10742baf06d01 /boehm-gc/malloc.c | |
parent | 005326029f35b4271c5274114a17126039fe18a0 (diff) | |
download | gcc-79f777fd1e10435cb50c4b45a664bd6ae280f2c1.zip gcc-79f777fd1e10435cb50c4b45a664bd6ae280f2c1.tar.gz gcc-79f777fd1e10435cb50c4b45a664bd6ae280f2c1.tar.bz2 |
Imported GC 6.1 Alpha 3. Finally.
From-SVN: r49698
Diffstat (limited to 'boehm-gc/malloc.c')
-rw-r--r-- | boehm-gc/malloc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/boehm-gc/malloc.c b/boehm-gc/malloc.c index 943f27d..5ac2142 100644 --- a/boehm-gc/malloc.c +++ b/boehm-gc/malloc.c @@ -337,6 +337,20 @@ DCL_LOCK_STATE; { return((GC_PTR)REDIRECT_MALLOC(n*lb)); } + +# include <string.h> +# ifdef __STDC__ + char *strdup(const char *s) +# else + char *strdup(s) + char *s; +# endif + { + size_t len = strlen + 1; + char * result = ((char *)REDIRECT_MALLOC(len+1)); + BCOPY(s, result, len+1); + return result; + } # endif /* REDIRECT_MALLOC */ /* Explicitly deallocate an object p. */ |