ocl::standard_allocator_type: Overview

C++ Implementation

Link

Brief

The pattern is a low-level system allocator designed to handle custom or standard allocators in the C++ programming language. Usages may vary from HFT to Low-Level API usage like ZLib.

Example

You can make use of the following:

using IntAlloc = ocl::standard_allocator_type<int>;

IntAlloc alloc;

int* raw = alloc.claim();
*raw = 5;
alloc.unclaim(raw);

Or you can use smart pointers.

auto ptr = alloc.construct<int>(5);
/// gets freed by the ABI using RAII!

Conclusion

I hope this pattern and the Open C++ Library will be useful to engineers! The library also includes Crc32, FIX, and a custom filesystem specification EmbdFs

Amlal.