From a3f8d3d8190991dc750a8ef3f91002bc9f877b26 Mon Sep 17 00:00:00 2001 From: rwatson Date: Tue, 25 Feb 2003 22:11:39 +0000 Subject: 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 --- sys/libkern/strdup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/libkern/strdup.c') 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); } -- cgit v1.1