From 15fad39e8a4c18f1ae14612a44c018047b82190d Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 2 Mar 2018 12:45:52 +1100 Subject: [PATCH] alloc/foreign: add warning about non-trivial child allocators --- alloc/raw/aligned/foreign.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/alloc/raw/aligned/foreign.hpp b/alloc/raw/aligned/foreign.hpp index 6c02412f..8df882bf 100644 --- a/alloc/raw/aligned/foreign.hpp +++ b/alloc/raw/aligned/foreign.hpp @@ -34,6 +34,11 @@ namespace util::alloc::raw::aligned { /// alignment /// * using a direct alignment child to service the requests /// * then applying the reverse offset to values as we return the values + /// + /// This approach will explode if a child allocator wants to write to the + /// range, so the user is mostly restricted to very simple allocators + /// (like 'linear'). This is why we use a view based at nullptr; any + /// mistaken access is quite a lot more likely to fault here. template class foreign { public: