mem.h revision 470122d12fa43f83f993ae8e93ba8e3cf4c674cd
45e9809aff7304721fddb95654901b32195c9c7avboxsync * IPRT - C++ Memory Resource Management.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright (C) 2006-2011 Oracle Corporation
45e9809aff7304721fddb95654901b32195c9c7avboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
45e9809aff7304721fddb95654901b32195c9c7avboxsync * available from http://www.virtualbox.org. This file is free software;
45e9809aff7304721fddb95654901b32195c9c7avboxsync * you can redistribute it and/or modify it under the terms of the GNU
45e9809aff7304721fddb95654901b32195c9c7avboxsync * General Public License (GPL) as published by the Free Software
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * The contents of this file may alternatively be used under the terms
45e9809aff7304721fddb95654901b32195c9c7avboxsync * of the Common Development and Distribution License Version 1.0
45e9809aff7304721fddb95654901b32195c9c7avboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * VirtualBox OSE distribution, in which case the provisions of the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * CDDL are applicable instead of those of the GPL.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * You may elect to license modified versions of this file under the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * terms and conditions of either the GPL or the CDDL or both.
45e9809aff7304721fddb95654901b32195c9c7avboxsync/** @defgroup grp_rt_cpp_autores_mem C++ Memory Resource Management
45e9809aff7304721fddb95654901b32195c9c7avboxsync * @ingroup grp_rt_cpp_autores
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Template function wrapping RTMemFree to get the correct a_fnDestruct
45e9809aff7304721fddb95654901b32195c9c7avboxsync * signature for RTCAutoRes.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * We can't use a more complex template here, because the g++ on RHEL 3
45e9809aff7304721fddb95654901b32195c9c7avboxsync * chokes on it with an internal compiler error.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * @tparam T The data type that's being managed.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * @param aMem Pointer to the memory that should be free.
return (T *)(NULL);
: RTCAutoRes<T *, a_fnDestruct, RTCMemAutoNil<T> >((T *)a_fnAllocator(NULL, a_cElements * sizeof(T), RTMEM_TAG))
return *this;
T &operator*()
T *operator->()