[haiku-commits] Re: haiku: hrev48664 - in src/add-ons/kernel: file_cache network/stack src

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 12 Jan 2015 23:32:18 +0100

On 01/12/2015 10:42 PM, Rene Gollent wrote:
On Jan 12, 2015 4:40 PM, "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx
<mailto:axeld@xxxxxxxxxxxxxxxx>> wrote:
 > geist just made a good point on IRC: khash would not resize itself
automatically. I haven't had the time to read over Adrien's changes, but
in the kernel you cannot always simply allocate memory.

OpenHashTable will return a failure from Insert if it can't allocate, so
that just needs to be checked (haven't looked yet if that's the case in
the recent refactoring).

The problem isn't allocation failure. As long as Init() was called successfully, allocation failures are handled internally and only affect performance. The issue are the allocations themselves. There are contexts where memory allocations aren't permitted or must be performed with special functions/flags. E.g. when interrupts disabled or in code that is used (directly or indirectly) by certain VM code paths (FS hooks related to paging come to mind).

CU, Ingo


Other related posts: