コード例 #1
0
ファイル: SC_PolyStore.cpp プロジェクト: jjayne/nSIGHTS
bool SC_PolyStore::Alloc(int np, int npP, int npI)
{
    DeAlloc();
    pointData.SetFixed();
    pointZ.SetFixed();
    polyPointIndx.SetFixed();

    try
        {
            polyStart.Alloc(np);

            polyN.AllocAndFill(np, 0);
            polyN.SetEmpty();

            pointData.Alloc(npP);
            pointZ.Alloc(npP);
            polyPointIndx.Alloc(npI);
        }
    catch (SC_Array::AllocationError)
        {
            DeAlloc();
            return false;
        }

    return true;
}
コード例 #2
0
ファイル: DC_XYData.cpp プロジェクト: jjayne/nSIGHTS
bool DC_XYData::CreateFrom(const SC_DoubleArray& inX,
                           const SC_DoubleArray& inY)
{
    try
        {
            if (xData.Size() != yData.Size())
                {
                    int maxSize = xData.Size();
                    if (yData.Size() > maxSize)
                        maxSize = yData.Size();
                    if (maxSize < 10)
                        maxSize = 10;
                    xData.Alloc(maxSize);
                    yData.Alloc(maxSize);
                }

            xData = inX;
            yData = inY;
        }
    catch (SC_Array::AllocationError& )
        {
            DeAlloc();
            return false;
        }

    CleanUp();
    return ! IsEmpty();
}
コード例 #3
0
void CAudBuffer::Alloc(const size_t size)
{
    DeAlloc();
    m_buffer = (uint8_t*)malloc_aligned(size, 16);
    m_buffer_size = size;
    m_buffer_pos = 0;
}
コード例 #4
0
ファイル: AEBuffer.cpp プロジェクト: Hooksdena36/xbmc
void CAEBuffer::Alloc(const size_t size)
{
    DeAlloc();
    m_buffer     = (uint8_t*)_aligned_malloc(size, 16);
    m_bufferSize = size;
    m_bufferPos  = 0;
}
コード例 #5
0
ファイル: SC_PolyStore.cpp プロジェクト: jjayne/nSIGHTS
SC_PolyStore& SC_PolyStore::operator= (const SC_PolyStore& a)
{
    if (this != &a)
        {
            DeAlloc();

            pointData     = a.pointData;
            pointZ        = a.pointZ;
            polyPointIndx = a.polyPointIndx;
            polyStart     = a.polyStart;
            polyN         = a.polyN;
            maxPolyPoint  = a.maxPolyPoint;
        }
    return *this;
}
コード例 #6
0
ファイル: DC_XYData.cpp プロジェクト: jjayne/nSIGHTS
bool DC_XYData::Alloc(int nRow)
{
    try
        {
            xData.Alloc(nRow);
            yData.Alloc(nRow);
        }
    catch (SC_Array::AllocationError& )
        {
            DeAlloc();
            return false;
        }

    return true;
}
コード例 #7
0
ファイル: TestAlloc.cpp プロジェクト: Strongc/DC_source
/*****************************************************************************
 * Function - CheckMemoryAvailable
 * DESCRIPTION: Allocates and DeAllocates a number of bytes
 *
 * Return:      The number of bytes that could be allocated
 *
 *****************************************************************************/
int TestAlloc::CheckMemoryAvailable(int bytes)
{
  static int old_memory = 0;
  static int difference = 0;
  static int diff_count = 0;

  int memory_allocated = Alloc(bytes);
  int memory_deallocated = DeAlloc();

  if (memory_allocated != memory_deallocated)
  {
    memory_deallocated = 0; // Realy bad, should not happen
  }

  difference = memory_allocated - old_memory;
  if (difference != 0)
  {
    // Ok in case of call from different tasks or if all memory is used
    diff_count++;
    old_memory = memory_allocated;
  }

  return memory_allocated;
}
コード例 #8
0
ファイル: SC_PolyStore.cpp プロジェクト: jjayne/nSIGHTS
SC_PolyStore::~SC_PolyStore()
{
    DeAlloc();
}
コード例 #9
0
ファイル: DC_XYData.cpp プロジェクト: jjayne/nSIGHTS
DC_XYData :: ~DC_XYData()
{
    DeAlloc();
}
コード例 #10
0
CAudBuffer::~CAudBuffer()
{
    DeAlloc();
}
コード例 #11
0
ファイル: AEBuffer.cpp プロジェクト: Hooksdena36/xbmc
CAEBuffer::~CAEBuffer()
{
    DeAlloc();
}