From e92d4ca5f52506673065a8e9161a30cfc2cbff96 Mon Sep 17 00:00:00 2001 From: leitner Date: Sat, 10 Jan 2004 00:05:18 +0000 Subject: [PATCH] prefetching leaked memory --- io/iob_prefetch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/io/iob_prefetch.c b/io/iob_prefetch.c index 1f40b83..86b1b07 100644 --- a/io/iob_prefetch.c +++ b/io/iob_prefetch.c @@ -11,6 +11,7 @@ void iob_prefetch(io_batch* b,uint64 bytes) { for (; etype==FROMFILE) { char* c,* d; + uint64 before=bytes; if (e->n>=1000000) { d=c=mmap(0,bytes,PROT_READ,MAP_SHARED,e->fd,(e->offset|4095)+1); if (c!=MAP_FAILED) { @@ -21,7 +22,7 @@ void iob_prefetch(io_batch* b,uint64 bytes) { (void)x; } } - munmap(c,bytes); + munmap(c,before); } return; }