diff options
author | dyson <dyson@FreeBSD.org> | 1997-08-05 00:02:08 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1997-08-05 00:02:08 +0000 |
commit | 8fa8ae3d0d6a785deced2be3e7fd647f31aaf23e (patch) | |
tree | c5bee309962268ed673826beec543a2de0ff70aa /sys/kern/sys_pipe.c | |
parent | 257e5090900068920bc5af171dec41a2939a084f (diff) | |
download | FreeBSD-src-8fa8ae3d0d6a785deced2be3e7fd647f31aaf23e.zip FreeBSD-src-8fa8ae3d0d6a785deced2be3e7fd647f31aaf23e.tar.gz |
Get rid of the ad-hoc memory allocator for vm_map_entries, in lieu of
a simple, clean zone type allocator. This new allocator will also be
used for machine dependent pmap PV entries.
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r-- | sys/kern/sys_pipe.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 53e1345..d2f36fd 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -16,7 +16,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: sys_pipe.c,v 1.27 1997/03/24 11:52:26 bde Exp $ + * $Id: sys_pipe.c,v 1.28 1997/04/09 16:53:39 bde Exp $ */ /* @@ -80,6 +80,7 @@ #include <vm/pmap.h> #include <vm/vm_map.h> #include <vm/vm_page.h> +#include <vm/vm_zone.h> /* * Use this define if you want to disable *fancy* VM things. Expect an @@ -144,6 +145,8 @@ static void pipe_clone_write_buffer __P((struct pipe *wpipe)); #endif static void pipespace __P((struct pipe *cpipe)); +vm_zone_t pipe_zone; + /* * The pipe system call for the DTYPE_PIPE type of pipes */ @@ -162,10 +165,20 @@ pipe(p, uap, retval) struct pipe *rpipe, *wpipe; int fd, error; + if (pipe_zone == NULL) + pipe_zone = zinit("PIPE", sizeof (struct pipe), 0, + ZONE_WAIT, 4); + + rpipe = zalloc( pipe_zone); +/* rpipe = malloc( sizeof (*rpipe), M_TEMP, M_WAITOK); +*/ pipeinit(rpipe); rpipe->pipe_state |= PIPE_DIRECTOK; +/* wpipe = malloc( sizeof (*wpipe), M_TEMP, M_WAITOK); +*/ + wpipe = zalloc( pipe_zone); pipeinit(wpipe); wpipe->pipe_state |= PIPE_DIRECTOK; @@ -1099,6 +1112,9 @@ pipeclose(cpipe) cpipe->pipe_buffer.size + PAGE_SIZE); } #endif + zfree(pipe_zone, cpipe); +/* free(cpipe, M_TEMP); +*/ } } |