diff -r 000000000000 -r bde4ae8d615e os/kernelhwsrv/kernel/eka/drivers/debug/smdebug/d_buffer_manager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/kernelhwsrv/kernel/eka/drivers/debug/smdebug/d_buffer_manager.cpp Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,105 @@ +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#include +#include "d_buffer_manager.h" + +using namespace Debug; + +// Global buffer manager +DBufferManager TheDBufferManager; + +DBufferManager::DBufferManager() + { + } + +DBufferManager::~DBufferManager() + { + for(TInt i=0; i0 && iBuffers[i].iValue) + { + Kern::Free((TAny*)iBuffers[i].iValue); + } + } + + iBuffers.Close(); + } + +/** + * Creates a buffer and adds it to the buffer manager + * @param aBufferDetails Contains the size and tag ID of the buffer to be created and the location + * in which the resulting buffer is created + * @return One of the System wide error codes + */ +TInt DBufferManager::CreateBuffer(TTag& aBufferDetails) + { + if(aBufferDetails.iType != ETagTypePointer) + { + return KErrArgument; + } + if(aBufferDetails.iSize == 0) + { + return KErrArgument; + } + + for(TInt i=0; i