Date: Sun, 16 Apr 2000 15:36:31 +0200 From: Poul-Henning Kamp <phk@critter.freebsd.dk> To: Anatoly Vorobey <mellon@pobox.com> Cc: hackers@FreeBSD.ORG Subject: Re: memory in the kernel Message-ID: <4887.955892191@critter.freebsd.dk> In-Reply-To: Your message of "Sun, 16 Apr 2000 12:30:38 -0000." <20000416123037.A24869@happy.checkpoint.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4887.955892191>