summaryrefslogtreecommitdiffstats
path: root/sys/libkern/strdup.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-02-25 22:11:39 +0000
committerrwatson <rwatson@FreeBSD.org>2003-02-25 22:11:39 +0000
commita3f8d3d8190991dc750a8ef3f91002bc9f877b26 (patch)
tree70fd88f9ba7b8e2d04834e82ef3c97ee8383e902 /sys/libkern/strdup.c
parented93a50e90cdfa5ea6810c133e52dcbe46d642a3 (diff)
downloadFreeBSD-src-a3f8d3d8190991dc750a8ef3f91002bc9f877b26.zip
FreeBSD-src-a3f8d3d8190991dc750a8ef3f91002bc9f877b26.tar.gz
Pass a malloc type into the libkern strdup() implementation explicitly,
so that callers can specify what malloc pool the resulting memory should come from. Requested by: phk
Diffstat (limited to 'sys/libkern/strdup.c')
-rw-r--r--sys/libkern/strdup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/libkern/strdup.c b/sys/libkern/strdup.c
index 74953ff..82cece0 100644
--- a/sys/libkern/strdup.c
+++ b/sys/libkern/strdup.c
@@ -42,13 +42,13 @@
MALLOC_DEFINE(M_STRING, "string", "string buffers");
char *
-strdup(const char *string)
+strdup(const char *string, struct malloc_type *type)
{
size_t len;
char *copy;
len = strlen(string) + 1;
- copy = malloc(len, M_STRING, M_WAITOK);
+ copy = malloc(len, type, M_WAITOK);
bcopy(string, copy, len);
return (copy);
}
OpenPOWER on IntegriCloud