Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(767)

Unified Diff: src/trusted/generic_container/container_hash_table.h

Issue 10905317: Generic containers moved into a separate module (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Rebased with master. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/trusted/generic_container/container.h ('k') | src/trusted/generic_container/container_hash_table.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/generic_container/container_hash_table.h
diff --git a/src/trusted/generic_container/container_hash_table.h b/src/trusted/generic_container/container_hash_table.h
new file mode 100644
index 0000000000000000000000000000000000000000..bc4fa4f7e1cb665167aef7ab84f3908866a10fa9
--- /dev/null
+++ b/src/trusted/generic_container/container_hash_table.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2012 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the LICENSE file.
+ */
+
+#ifndef NATIVE_CLIENT_SRC_TRUSTED_GENERIC_CONTAINER_CONTAINER_HASH_TABLE_H_
+#define NATIVE_CLIENT_SRC_TRUSTED_GENERIC_CONTAINER_CONTAINER_HASH_TABLE_H_
+
+#include "native_client/src/include/nacl_base.h"
+#include "native_client/src/include/portability.h"
+
+#include "native_client/src/trusted/generic_container/container.h"
+
+EXTERN_C_BEGIN
+
+struct NaClContainerHashTblEntry {
+ int flags;
+ void *datum;
+};
+
+#define NACL_CHTE_USED (1<<0)
+/* slot occupied, so keep probing */
+
+#define NACL_CHTE_DELETED (1<<1)
+/* slot occupied but deleted, keep probing */
+
+struct NaClContainerHashTbl {
+ struct NaClContainer base;
+ struct NaClHashFunctor *hash_functor;
+ size_t num_buckets;
+ size_t num_entries;
+ struct NaClContainerHashTblEntry *bucket;
+};
+
+int NaClContainerHashTblCtor(struct NaClContainerHashTbl *self,
+ struct NaClHashFunctor *hash_functor,
+ size_t num_buckets);
+
+int NaClContainerHashTblInsert(struct NaClContainer *vself,
+ void *obj);
+
+struct NaClContainerIter *NaClContainerHashTblFind(
+ struct NaClContainer *vself,
+ void *key,
+ struct NaClContainerIter *out);
+
+void NaClContainerHashTblDtor(struct NaClContainer *vself);
+
+struct NaClContainerHashTblIter {
+ struct NaClContainerIter base;
+ struct NaClContainerHashTbl *htbl;
+ uintptr_t idx;
+};
+
+int NaClContainerHashTblIterCtor(struct NaClContainer *vself,
+ struct NaClContainerIter *viter);
+
+EXTERN_C_END
+
+#endif /* NATIVE_CLIENT_SRC_TRUSTED_GENERIC_CONTAINER_CONTAINER_HASH_TABLE_H_ */
« no previous file with comments | « src/trusted/generic_container/container.h ('k') | src/trusted/generic_container/container_hash_table.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698