From owner-freebsd-current Sun Apr 21 03:00:51 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id DAA11898 for current-outgoing; Sun, 21 Apr 1996 03:00:51 -0700 (PDT) Received: from bunyip.cc.uq.oz.au (pp@bunyip.cc.uq.oz.au [130.102.2.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id DAA11893 for ; Sun, 21 Apr 1996 03:00:49 -0700 (PDT) Received: from bunyip.cc.uq.oz.au by bunyip.cc.uq.oz.au id <14759-0@bunyip.cc.uq.oz.au>; Sun, 21 Apr 1996 20:00:33 +1000 Received: from netfl15a.devetir.qld.gov.au by pandora.devetir.qld.gov.au (8.6.10/DEVETIR-E0.3a) with ESMTP id QAA02473 for ; Sun, 21 Apr 1996 16:48:25 +1000 Received: from localhost by netfl15a.devetir.qld.gov.au (8.6.8.1/DEVETIR-0.1) id GAA19816 for ; Sun, 21 Apr 1996 06:51:39 GMT Message-Id: <199604210651.GAA19816@netfl15a.devetir.qld.gov.au> X-Mailer: exmh version 1.6.5 12/11/95 To: current@freebsd.org Subject: mmap vs malloc - what gives? X-Face: 3}heU+2?b->-GSF-G4T4>jEB9~FR(V9lo&o>kAy=Pj&;oVOc<|pr%I/VSG"ZD32J>5gGC0N 7gj]^GI@M:LlqNd]|(2OxOxy@$6@/!,";-!OlucF^=jq8s57$%qXd/ieC8DhWmIy@J1AcnvSGV\|*! >Bvu7+0h4zCY^]{AxXKsDTlgA2m]fX$W@'8ev-Qi+-;%L'CcZ'NBL!@n?}q!M&Em3*eW7,093nOeV8 M)(u+6D;%B7j\XA/9j4!Gj~&jYzflG[#)E9sI&Xe9~y~Gn%fA7>F:YKr"Wx4cZU*6{^2ocZ!YyR Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 21 Apr 1996 16:51:38 +1000 From: Stephen Hocking Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Mixing mmap & malloc appears to be a recipe for much grief. mmap doesn't seem to take much notice of what's already malloced and occasionally drops its region over the top of some already malloced space. I've tried with the addr parameter set to something which is malloced to be the same size as the file being mmaped in, I've tried it set to zero, I've tried doing my mallocing all before the mmap and (where possible) all after. No dice. (For the curious, the application in question is a re-implementation of the doom soundserver which gropes through the wadfile using mmap. I'm re-implementing it so I can send the sounds off to the NAS soundserver) Stephen -- The views expressed above are not those of the Worker's Compensation Board of Queensland, Australia.