From a8e99f3a783069cf85b626c6cfb2fbe83ae4fd44 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 29 Nov 2025 14:53:01 -0500 Subject: chore: new version of OCL and codebase cleanup. Signed-off-by: Amlal El Mahrouss --- examples/allocator_system/CMakeLists.txt | 16 -------- examples/allocator_system/allocator_system.cc | 53 --------------------------- 2 files changed, 69 deletions(-) delete mode 100644 examples/allocator_system/CMakeLists.txt delete mode 100644 examples/allocator_system/allocator_system.cc (limited to 'examples/allocator_system') diff --git a/examples/allocator_system/CMakeLists.txt b/examples/allocator_system/CMakeLists.txt deleted file mode 100644 index a4bb69d..0000000 --- a/examples/allocator_system/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ - -cmake_minimum_required(VERSION 3.15...3.31) - -project( - Alloc - VERSION 1.0 - LANGUAGES CXX) - -find_package(Boost REQUIRED COMPONENTS container) - -add_executable(Alloc allocator_system.cc) - -target_link_libraries(Alloc PRIVATE Boost::container) - -set_property(TARGET Alloc PROPERTY CXX_STANDARD 20) -target_include_directories(Alloc PUBLIC ../../include/ocl) diff --git a/examples/allocator_system/allocator_system.cc b/examples/allocator_system/allocator_system.cc deleted file mode 100644 index fd7ae56..0000000 --- a/examples/allocator_system/allocator_system.cc +++ /dev/null @@ -1,53 +0,0 @@ -/* - * File: allocator_system.cc - * Purpose: Allocator System container. - * Author: Amlal El Mahrouss (amlal@nekernel.org) - * Copyright 2025, Amlal El Mahrouss, Licensed under the Boost Software License. Licensed under the BSL 1.0 license - */ - -#include -#include - -class MyClass final -{ -public: - int a{}; - std::string b{}; - - MyClass() : a(0), b("default") - { - std::cout << "MyClass() constructed\n"; - } - - MyClass(int x, std::string y) : a(x), b(std::move(y)) - { - std::cout << "MyClass(int, string) constructed\n"; - } - - ~MyClass() - { - std::cout << "~MyClass() destroyed\n"; - } -}; - -int main() -{ - ocl::standard_allocator_type allocator; - - // Test 1: claim() + unclaim() - std::cout << "=== Test 1: claim/unclaim ===\n"; - - MyClass* raw = allocator.claim(); - - std::cout << "raw->a = " << raw->a << ", raw->b = " << raw->b << "\n"; - allocator.unclaim(raw); // Manual delete - - // Test 2: construct() → shared_ptr - std::cout << "\n=== Test 2: construct (shared_ptr) ===\n"; - - auto ptr = allocator.construct(42, "hello"); - std::cout << "ptr->a = " << ptr->a << ", ptr->b = " << ptr->b << "\n"; - - // `shared_ptr` will automatically delete the object - std::cout << "\n=== End of main ===\n"; -} -- cgit v1.2.3