Made usable from userland.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29335 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-02-27 16:11:57 +00:00
parent 9bb78ee296
commit 42ef52132a

View File

@ -6,8 +6,12 @@
#define _KERNEL_UTIL_OPEN_HASH_TABLE_H #define _KERNEL_UTIL_OPEN_HASH_TABLE_H
#include <KernelExport.h> #include <OS.h>
#include <util/kernel_cpp.h>
#ifdef _KERNEL_MODE
# include <KernelExport.h>
# include <util/kernel_cpp.h>
#endif
/*! /*!
@ -116,8 +120,13 @@ public:
void InsertUnchecked(ValueType *value) void InsertUnchecked(ValueType *value)
{ {
if (CheckDuplicates && _ExhaustiveSearch(value)) if (CheckDuplicates && _ExhaustiveSearch(value)) {
#ifdef _KERNEL_MODE
panic("Hash Table: value already in table."); panic("Hash Table: value already in table.");
#else
debugger("Hash Table: value already in table.");
#endif
}
_Insert(fTable, fTableSize, value); _Insert(fTable, fTableSize, value);
fItemCount++; fItemCount++;
@ -160,8 +169,13 @@ public:
if (slot == NULL) if (slot == NULL)
return false; return false;
if (CheckDuplicates && _ExhaustiveSearch(value)) if (CheckDuplicates && _ExhaustiveSearch(value)) {
#ifdef _KERNEL_MODE
panic("Hash Table: duplicate detected."); panic("Hash Table: duplicate detected.");
#else
debugger("Hash Table: duplicate detected.");
#endif
}
fItemCount--; fItemCount--;
return true; return true;