[libc-commits] [libc] [libc] [search] implement hcreate(_r)/hsearch(_r)/hdestroy(_r) (PR #73469)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Mon Nov 27 13:24:34 PST 2023


================
@@ -0,0 +1,25 @@
+//===-- Implementation of hdestroy_r ----------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/search/hdestroy_r.h"
+#include "src/__support/HashTable/table.h"
+#include "src/errno/libc_errno.h"
+
+namespace LIBC_NAMESPACE {
+LLVM_LIBC_FUNCTION(void, hdestroy_r, (struct hsearch_data * htab)) {
+  using namespace internal;
----------------
nickdesaulniers wrote:

let's be consistent in the use of `using namespace internal;` for the implementations.  i.e. `using namespace internal;` is not used in the definition of `hsearch` or `hsearch_r` below (and `hcreate_r` above).

https://github.com/llvm/llvm-project/pull/73469


More information about the libc-commits mailing list