1//===- MemoryFactory.h ----------------------------------------------------===// 2// 3// The MCLinker Project 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef ALONE_SUPPORT_MEMORY_FACTORY_H 11#define ALONE_SUPPORT_MEMORY_FACTORY_H 12 13#include <mcld/Support/FileHandle.h> 14#include <mcld/Support/MemoryAreaFactory.h> 15 16namespace mcld { 17class MemoryArea; 18} // end namespace mcld 19 20namespace alone { 21 22class MemoryFactory : public mcld::MemoryAreaFactory { 23public: 24 MemoryFactory() : mcld::MemoryAreaFactory(32) { } 25 26 ~MemoryFactory() { } 27 28 using mcld::MemoryAreaFactory::produce; 29 30 mcld::MemoryArea* produce(void *pMemBuffer, size_t pSize) 31 { return mcld::MemoryAreaFactory::create(pMemBuffer, pSize); } 32 33 mcld::MemoryArea* produce(int pFD) 34 { return mcld::MemoryAreaFactory::create(pFD, mcld::FileHandle::Unknown); } 35}; 36 37} // end namespace alone 38 39#endif // ALONE_SUPPORT_MEMORY_FACTORY_H 40