/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
****************************************************************************/

#pragma once

#include <cstddef>
#include "glmCoreAPI.h"

namespace glm
{
	/**
	* \brief Utility struct to record allocations.
	*
	* This class is used by AllocationsMap to memorize the allocation operations in debug mode.
	* For each allocation, the address and size of the allocated block is stored, as well as a unique
	* memory operation ID. The latter can be used to precisely identify the operation which caused
	* a memory leak ( see AllocationsMap class ).
	*
	*/
	struct AllocationInfo
	{
		/**
		* \brief constructor
		* \param address address of the allocated block
		* \param size size of the allocated block
		*/
		AllocationInfo( void* address, std::size_t size ) ;

		mutable unsigned int _memoryOperationID ;	//!< memory operation id
		void* _address ;							//!< address of the allocated memory block
		std::size_t _size ;							//!< size of the allocated memory block
	} ;

	//-------------------------------------------------------------------------
	// constructor
	//-------------------------------------------------------------------------
	inline AllocationInfo::AllocationInfo( void* address, std::size_t size )
		:
	_memoryOperationID( 0 ),
		_address( address ),
		_size( size )
	{
	}
}

