C CASTLE / MODULE NOTES
CASTLE/Modules/Memory

MODULE 12 / 15

Memory

Low-level helpers for alignment, storage, construction, destruction, and explicit object lifetime.

#include "castle/memory/memory.hpp"

Overview

Umbrella header that includes Castle's low-level memory helpers in one place. Use it when a translation unit needs several of these components together and the extra include breadth is acceptable.

Dependencies

  • addressof
  • alignment
  • construct
  • destroy
  • lifetime
  • new
  • object
  • soo_buffer
  • static_storage
  • storage

Public API

This header adds no new declarations. It re-exports the public APIs from:

  • castle/memory/addressof.hpp
  • castle/memory/alignment.hpp
  • castle/memory/construct.hpp
  • castle/memory/destroy.hpp
  • castle/memory/lifetime.hpp
  • castle/memory/new.hpp
  • castle/memory/object.hpp
  • castle/memory/soo_buffer.hpp
  • castle/memory/static_storage.hpp
  • castle/memory/storage.hpp

Usage example

See samples/sample_memory.cpp.

#include "castle/memory/memory.hpp"

Constraints & notes

  • Allocation behavior, alignment rules, and lifetime preconditions come from the included component headers.
  • This is a convenience include only; choose narrower headers when compile-time dependency size matters.