From owner-freebsd-current@FreeBSD.ORG Fri Jun 17 21:39:25 2005 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 59DC816A41C; Fri, 17 Jun 2005 21:39:25 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from pasmtp.tele.dk (pasmtp.tele.dk [193.162.159.95]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B6A843D4C; Fri, 17 Jun 2005 21:39:25 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (0x535c0e2a.sgnxx1.adsl-dhcp.tele.dk [83.92.14.42]) by pasmtp.tele.dk (Postfix) with ESMTP id 3B8321EC31E; Fri, 17 Jun 2005 23:39:24 +0200 (CEST) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.4/8.13.3) with ESMTP id j5HLdLEu058748; Fri, 17 Jun 2005 23:39:21 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Peter Edwards From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 17 Jun 2005 18:02:32 -0000." <20050617180232.GA25818@freefall.freebsd.org> Date: Fri, 17 Jun 2005 23:39:21 +0200 Message-ID: <58747.1119044361@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: current@FreeBSD.org Subject: Re: Towards a working "wine". [long] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2005 21:39:25 -0000 In message <20050617180232.GA25818@freefall.freebsd.org>, Peter Edwards writes: >There is a disasterously ugly hack attached, wine_malloc.txt that >hacks on malloc(), and adds a "W" option to enable the hack. This >works by trading the brk()/sbrk() calls for an mmapping starting >at 0xa0000000, which should be able to grow towards the process >stack. (phkmalloc works with a large contiguous heap, rather than >a fragmented one, so a more "pure" mmap-based approach won't fit >into it too smoothly.) phkmalloc works just fine with a fragmented heap, but allocates too much memory for the page-map if all the memory is too far away from "_end". The correct (and portable) fix is to give phkmalloc a treee-structure instead of a linear array to manage the page table. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.