From 4a4a611618e8ff6d5ad41c0e944ec39ce1bd0e52 Mon Sep 17 00:00:00 2001 From: Nick Ing-Simmons Date: Mon, 6 Nov 2000 20:07:28 +0000 Subject: [PATCH] Remove debug. Try (Mmap_t) on madvise() call. p4raw-id: //depot/perlio@7574 --- perlio.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/perlio.c b/perlio.c index d2fcc56..7cd3e09 100644 --- a/perlio.c +++ b/perlio.c @@ -249,6 +249,9 @@ PerlIO_cleantable(PerlIO **tablep) } } +HV *PerlIO_layer_hv; +AV *PerlIO_layer_av; + void PerlIO_cleanup(void) { @@ -318,9 +321,6 @@ XS(XS_perlio_unimport) XSRETURN_EMPTY; } -HV *PerlIO_layer_hv; -AV *PerlIO_layer_av; - SV * PerlIO_find_layer(char *name, STRLEN len) { @@ -1643,11 +1643,8 @@ PerlIOBuf_seek(PerlIO *f, Off_t offset, int whence) if (code == 0) { b->posn = PerlIO_tell(PerlIONext(f)); - PerlIO_debug(__FUNCTION__ " f=%p posn=%ld\n",f,(long) b->posn); } } - if (code) - PerlIO_debug(__FUNCTION__ " f=%p code%d\n",f,code); return code; } @@ -1658,7 +1655,6 @@ PerlIOBuf_tell(PerlIO *f) Off_t posn = b->posn; if (b->buf) posn += (b->ptr - b->buf); - PerlIO_debug(__FUNCTION__ " f=%p posn=%ld\n",f,(long) posn); return posn; } @@ -1823,12 +1819,10 @@ PerlIOMmap_map(PerlIO *f) if (len > 0) { b->buf = (STDCHAR *) mmap(NULL, len, PROT_READ, MAP_PRIVATE, fd, b->posn); - PerlIO_debug(__FUNCTION__ " f=%p b=%p for %ld @ %ld\n", - f, b->buf, (long) len, (long) b->posn); if (b->buf && b->buf != (STDCHAR *) -1) { #if defined(HAS_MADVISE) && defined(MADV_SEQUENTIAL) - madvise(b->buf, len, MADV_SEQUENTIAL); + madvise((Mmap_t) b->buf, len, MADV_SEQUENTIAL); #endif PerlIOBase(f)->flags = flags | PERLIO_F_RDBUF; b->end = b->buf+len; @@ -1867,8 +1861,6 @@ PerlIOMmap_unmap(PerlIO *f) m->len = 0; if (PerlIO_seek(PerlIONext(f),b->posn,SEEK_SET) != 0) code = -1; - PerlIO_debug(__FUNCTION__ " f=%p b=%p c=%ld posn=%ld\n", - f,b->buf,(long)m->len,(long) b->posn); } b->ptr = b->end = b->buf; PerlIOBase(f)->flags &= ~(PERLIO_F_RDBUF|PERLIO_F_WRBUF); @@ -1922,7 +1914,7 @@ PerlIOMmap_unread(PerlIO *f, const void *vbuf, Size_t count) } if (m->len) { - PerlIO_debug(__FUNCTION__ " f=%p %d '%.*s'\n",f,count,count,(char *)vbuf); + /* Loose the unwritable mapped buffer */ PerlIO_flush(f); } return PerlIOBuf_unread(f,vbuf,count); @@ -1976,8 +1968,6 @@ PerlIOMmap_flush(PerlIO *f) m->bbuf = b->buf; } } - if (code) - PerlIO_debug(__FUNCTION__ " f=%p %d\n",f,code); return code; } @@ -1986,16 +1976,13 @@ PerlIOMmap_fill(PerlIO *f) { PerlIOBuf *b = PerlIOSelf(f,PerlIOBuf); IV code = PerlIO_flush(f); - PerlIO_debug(__FUNCTION__ " f=%p flush posn=%ld\n",f,(long)b->posn); if (code == 0 && !b->buf) { code = PerlIOMmap_map(f); - PerlIO_debug(__FUNCTION__ " f=%p mmap code=%d posn=%ld\n",f,code,(long)b->posn); } if (code == 0 && !(PerlIOBase(f)->flags & PERLIO_F_RDBUF)) { code = PerlIOBuf_fill(f); - PerlIO_debug(__FUNCTION__ " f=%p fill code=%d posn=%ld\n",f,code,(long)b->posn); } return code; } @@ -2014,7 +2001,6 @@ PerlIOMmap_close(PerlIO *f) } if (PerlIOBuf_close(f) != 0) code = -1; - PerlIO_debug(__FUNCTION__ " f=%p %d\n",f,code); return code; } -- 2.7.4