Skip to content

Commit a4c458e

Browse files
committed
Initial release v0.1.0
1 parent d55318c commit a4c458e

File tree

9 files changed

+2778
-1
lines changed

9 files changed

+2778
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@
3939

4040
# debug information files
4141
*.dwo
42+
43+
build/
44+
.vscode/
45+

CHANGELOG

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.1.0] - 2025-01-23
9+
10+
### Added
11+
- Initial release of slick_object_pool
12+
- Lock-free multi-producer multi-consumer (MPMC) object pool implementation
13+
- Header-only library design for easy integration
14+
- C++20 compliant implementation
15+
- Cache-line aligned atomic operations to prevent false sharing
16+
- O(1) constant-time allocation and deallocation
17+
- Power-of-2 ring buffer with efficient bitwise indexing
18+
- Automatic heap fallback when pool is exhausted
19+
- Cross-platform support (Windows, Linux, macOS)
20+
- Comprehensive test suite with Google Test
21+
- CMake build system with FetchContent support
22+
- Support for AddressSanitizer, ThreadSanitizer, and UndefinedBehaviorSanitizer
23+
- Type safety with static assertions for trivially copyable types
24+
- Thread-safe operations for concurrent access
25+
- Detailed documentation and usage examples
26+
- MIT License
27+
28+
### Features
29+
- `ObjectPool<T>` class template for type-safe object pooling
30+
- `allocate_object()` method for O(1) object allocation
31+
- `free_object()` method for O(1) object deallocation
32+
- `size()` method to query pool capacity
33+
- Namespace: `slick::ObjectPool<T>`
34+
- Include path: `<slick/object_pool.h>`
35+
36+
### Documentation
37+
- Comprehensive README with architecture details
38+
- Usage examples for basic, multi-threaded scenarios
39+
- API reference documentation
40+
- Performance benchmarks and comparisons
41+
- Best practices and limitations guide
42+
- TESTING.md with detailed sanitizer instructions
43+
- DOCUMENTATION.md with implementation details
44+
45+
### Platform Support
46+
- Windows (MSVC, MinGW)
47+
- Linux (GCC 10+, Clang 11+)
48+
- macOS (Clang 11+)
49+
- POSIX-compliant systems
50+
51+
[0.1.0]: https://github.com/SlickQuant/slick_object_pool/releases/tag/v0.1.0

CMakeLists.txt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
cmake_minimum_required(VERSION 3.25)
2+
3+
set(BUILD_VERSION 0.1.0)
4+
project(slick_object_pool VERSION ${BUILD_VERSION} LANGUAGES CXX)
5+
6+
set(CMAKE_CXX_STANDARD 20)
7+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
8+
set(CMAKE_CXX_EXTENSIONS OFF)
9+
10+
# Add header-only library
11+
add_library(slick_object_pool INTERFACE)
12+
target_include_directories(slick_object_pool INTERFACE
13+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
14+
$<INSTALL_INTERFACE:include>
15+
)
16+
if(UNIX AND NOT APPLE)
17+
target_link_libraries(slick_object_pool INTERFACE rt atomic)
18+
endif()
19+
20+
option(BUILD_SLICK_OBJECTPOOL_TESTS "Build tests" ON)
21+
if(BUILD_SLICK_OBJECTPOOL_TESTS)
22+
if (WIN32)
23+
add_subdirectory(tests)
24+
else()
25+
add_subdirectory(tests EXCLUDE_FROM_ALL)
26+
endif()
27+
endif()
28+
29+
# Installation rules
30+
install(DIRECTORY include/ DESTINATION include)
31+
32+
message(STATUS "slick_object_pool: ${BUILD_VERSION}")
33+
34+
if(CMAKE_BUILD_TYPE STREQUAL "Release")
35+
add_custom_target(dist_slick_object_pool ALL
36+
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/dist/include
37+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
38+
COMMENT "Copying slick_object_pool headers to dist/include"
39+
VERBATIM
40+
)
41+
42+
if (PROJECT_IS_TOP_LEVEL)
43+
add_custom_target(package_slick_object_pool ALL
44+
COMMAND ${CMAKE_COMMAND} -E tar "cfv" "${CMAKE_BINARY_DIR}/dist/slick_object_pool_${BUILD_VERSION}.zip" --format=zip "include"
45+
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/dist"
46+
COMMENT "Creating zip archive"
47+
)
48+
49+
add_dependencies(package_slick_object_pool dist_slick_object_pool)
50+
endif()
51+
endif()

0 commit comments

Comments
 (0)