From owner-freebsd-hackers Sun Apr 16 6:36:39 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.40.131]) by hub.freebsd.org (Postfix) with ESMTP id E72A237B958 for ; Sun, 16 Apr 2000 06:36:35 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost.freebsd.dk [127.0.0.1]) by critter.freebsd.dk (8.9.3/8.9.3) with ESMTP id PAA04889; Sun, 16 Apr 2000 15:36:32 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Anatoly Vorobey Cc: hackers@FreeBSD.ORG Subject: Re: memory in the kernel In-reply-to: Your message of "Sun, 16 Apr 2000 12:30:38 -0000." <20000416123037.A24869@happy.checkpoint.com> Date: Sun, 16 Apr 2000 15:36:31 +0200 Message-ID: <4887.955892191@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <20000416123037.A24869@happy.checkpoint.com>, Anatoly Vorobey writes : >I have to malloc a lot of memory in the kernel, hence a few >questions: How much is "a lot" ? >1. The data must be absolutely present at all times, no page >faults or locking mechanisms, etc. Does that mean >I should use kmem_alloc_wired() or am I misunderstanding its purpose? >Does it make sense to alloc less than a pageful or is the rest simply >going to be wasted? malloc(9) should be used. > >2. Unfortunately, I need to realloc a lot as data is dynamic and I >don't know sizes beforehand. How do I do that? Do I malloc a new >region, copy manually and release the old one? Yes, we have no realloc(9). -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD coreteam member | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message