6 # define malloc(n) GC_MALLOC(n)
7 # define calloc(m,n) GC_MALLOC((m)*(n))
8 # define free(p) GC_FREE(p)
9 # define realloc(p,n) GC_REALLOC((p),(n))
13 my_strdup (char const *s
)
15 size_t len
= strlen (s
);
16 void *t
= GC_MALLOC (len
+ 1);
19 return (char *) memcpy (t
, s
, len
+ 1);
22 # define strdup(s) my_strdup(s)
25 my_strndup (char const *s
, size_t n
)
27 size_t len
= strnlen (s
, n
);
28 char *t
= (char *) GC_MALLOC (len
+ 1);
32 return (char *) memcpy (t
, s
, len
);
35 # define strndup(s, n) my_strndup(s, n)