///////////////////////////////////////////////////////////////////////////////
// EAGeneralAllocatorDebugArm
//
// Copyright (c) 2010, Electronic Arts. All Rights Reserved.
// By Paul Pedriana
//
// This module implements a platform-specific call stack functionality. 
///////////////////////////////////////////////////////////////////////////////


#include <PPMalloc/internal/config.h>
#include <PPMalloc/internal/callstack.h>

#if !PPM_USE_EATHREAD_CALLSTACK

#include <EABase/eabase.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>


// To do: Copy the callstack reading code from the EACallstack package once that is debugged.


namespace EA
{
    namespace Allocator
    {

        PPM_API void InitCallstack()
        {
            // Empty
        }


        PPM_API void ShutdownCallstack()
        {
            // Empty
        }


        /// GetCallStack
        /// Returns number of non-zero entries written. The return value may be zero.
        /// Note that the memory size of the entries is thus the return value * sizeof(void).
        /// The first entry in the returned array is the return address of the calling function;
        /// the second entry is the returned addess of the first entry's calling function, etc.
        /// Due to the complications that are often involved in doing stack traces, this function
        /// may return addresses that are invalid (NULL pointers or otherwise). The user should 
        /// be prepared for this and gracefully deal with such addresses.
        ///
        PPM_API size_t GetCallStack(void* /*pReturnAddressArray*/[], size_t /*nReturnAddressArrayCapacity*/)
        {
            return 0;
        }

    } // namespace Allocator

} // namespace EA

#endif

