Skip to content

Commit 6db20f2

Browse files
committed
format
1 parent 8c25f25 commit 6db20f2

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

src/neuron/container/pool.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,21 @@ class Pool {
105105
template <typename T, bool Mutex>
106106
T* Pool<T, Mutex>::allocate_pool(long count) {
107107
T* p{};
108-
if(subcount_ > 1){
108+
if (subcount_ > 1) {
109109
p = static_cast<T*>(
110110
nrn_cacheline_calloc(reinterpret_cast<void**>(&p), count * subcount_, sizeof(T)));
111-
}else{
111+
} else {
112112
p = new T[count];
113113
}
114114
return p;
115115
}
116116

117117
template <typename T, bool Mutex>
118118
void Pool<T, Mutex>::deallocate_pool(T* p) {
119-
if(subcount_ > 1){
119+
if (subcount_ > 1) {
120120
free(p);
121-
}else{
122-
delete []p;
121+
} else {
122+
delete[] p;
123123
}
124124
}
125125

test/unit_tests/container/pool.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ TEST_CASE("Pool: basic single-object alloc and free", "[Pool]") {
3939
REQUIRE(a != b);
4040
}
4141

42-
SECTION("hpfree allows reuse") {
43-
SimpleItem* a = pool.alloc();
44-
pool.hpfree(a);
45-
SimpleItem* b = pool.alloc();
46-
// After freeing, the same slot can be reused
47-
//REQUIRE(b == a);
48-
}
49-
5042
SECTION("nget tracks outstanding allocations") {
5143
REQUIRE(pool.nget() == 0);
5244
SimpleItem* a = pool.alloc();

0 commit comments

Comments
 (0)