Compare commits

..

2 Commits

3 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,9 @@ project(allocPool)
set(CMAKE_CXX_STANDARD 23)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
add_executable(allocPool main.cpp
allocPool.hpp
tests.cpp

View File

@ -24,6 +24,11 @@ public:
initArray(defaultAllocNumbers);
}
~allocPool() {
for (auto i: vec)
delete i;
}
T *getPtr() {
if (pivot == 0)
resizeVec();

View File

@ -34,6 +34,5 @@ int main() {
std::cout << "Time (milliseconds) required for real allocations when constructing pool: " <<
std::chrono::duration_cast<std::chrono::milliseconds>(endAlloc - startAlloc).count() << "\n";
return 0;
}