C++ fix: custom allocator (pass around resource information structure)