Skip to content

Commit 6503eff

Browse files
[libc] remove BlockStore from cpp namespace (#85312)
The cpp namespace should only be used to mirror APIs from C++'s std:: namespace (at least until we share more code with libc++, see https://discourse.llvm.org/t/rfc-project-hand-in-hand-llvm-libc-libc-code-sharing/77701)
1 parent ea628f0 commit 6503eff

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

libc/src/__support/blockstore.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <stdint.h>
1717

1818
namespace LIBC_NAMESPACE {
19-
namespace cpp {
2019

2120
// The difference between BlockStore a traditional vector types is that,
2221
// when more capacity is desired, a new block is added instead of allocating
@@ -203,7 +202,6 @@ void BlockStore<T, BLOCK_SIZE, REVERSE_ORDER>::destroy(
203202
template <typename T, size_t BLOCK_SIZE>
204203
using ReverseOrderBlockStore = BlockStore<T, BLOCK_SIZE, true>;
205204

206-
} // namespace cpp
207205
} // namespace LIBC_NAMESPACE
208206

209207
#endif // LLVM_LIBC_SRC___SUPPORT_BLOCKSTORE_H

libc/src/stdlib/atexit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct AtExitUnit {
3636
// mutexes simply passthrough. We will need a lock free stack.
3737
using ExitCallbackList = FixedVector<AtExitUnit, 64>;
3838
#elif defined(LIBC_COPT_PUBLIC_PACKAGING)
39-
using ExitCallbackList = cpp::ReverseOrderBlockStore<AtExitUnit, 32>;
39+
using ExitCallbackList = ReverseOrderBlockStore<AtExitUnit, 32>;
4040
#else
4141
// BlockStore uses dynamic memory allocation. To avoid dynamic memory
4242
// allocation in tests, we use a fixed size callback list when built for

libc/test/src/__support/blockstore_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class LlvmLibcBlockStoreTest : public LIBC_NAMESPACE::testing::Test {
1919
public:
2020
template <size_t BLOCK_SIZE, size_t ELEMENT_COUNT, bool REVERSE>
2121
void populate_and_iterate() {
22-
LIBC_NAMESPACE::cpp::BlockStore<Element, BLOCK_SIZE, REVERSE> block_store;
22+
LIBC_NAMESPACE::BlockStore<Element, BLOCK_SIZE, REVERSE> block_store;
2323
for (int i = 0; i < int(ELEMENT_COUNT); ++i)
2424
ASSERT_TRUE(block_store.push_back({i, 2 * i, 3 * unsigned(i)}));
2525
auto end = block_store.end();
@@ -38,12 +38,12 @@ class LlvmLibcBlockStoreTest : public LIBC_NAMESPACE::testing::Test {
3838
}
3939
}
4040
ASSERT_EQ(i, int(ELEMENT_COUNT));
41-
LIBC_NAMESPACE::cpp::BlockStore<Element, BLOCK_SIZE, REVERSE>::destroy(
41+
LIBC_NAMESPACE::BlockStore<Element, BLOCK_SIZE, REVERSE>::destroy(
4242
&block_store);
4343
}
4444

4545
template <bool REVERSE> void back_test() {
46-
using LIBC_NAMESPACE::cpp::BlockStore;
46+
using LIBC_NAMESPACE::BlockStore;
4747
BlockStore<int, 4, REVERSE> block_store;
4848
for (int i = 0; i < 20; i++)
4949
ASSERT_TRUE(block_store.push_back(i));
@@ -53,7 +53,7 @@ class LlvmLibcBlockStoreTest : public LIBC_NAMESPACE::testing::Test {
5353
}
5454

5555
template <bool REVERSE> void empty_test() {
56-
using LIBC_NAMESPACE::cpp::BlockStore;
56+
using LIBC_NAMESPACE::BlockStore;
5757
BlockStore<int, 2, REVERSE> block_store;
5858

5959
ASSERT_TRUE(block_store.empty());

0 commit comments

Comments
 (0)