Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

template<class StorT>
StorT* Impala::Core::Array::ArraySystem::Allocate ( size_t  n,
StorT   
) [inline]

Definition at line 35 of file ArraySystem.h.

References Impala::Process::MemoryInfo::Bytes2String(), ILOG_DEBUG, ILOG_ERROR, mMap, mMemUse, mNrAlloc, and Impala::Process::MemoryInfo::PrintUsage().

Referenced by Impala::Core::Array::Array2dTem< ElemT, 1, ElemT >::Array2dTem().

00036     {
00037         size_t oldMem = mMemUse;
00038         mMemUse += n * sizeof(StorT);
00039         mNrAlloc++;
00040         StorT* p = 0;
00041         try
00042         {
00043             p = (StorT*)(operator new(n * sizeof(StorT)));
00044         }
00045         catch (std::bad_alloc)
00046         {
00047             p = 0;
00048         }
00049         if (p == 0)
00050         {
00051             String b = Process::MemoryInfo::Bytes2String(n * sizeof(StorT));
00052             ILOG_ERROR("Couldn't allocate " << n << " x " << sizeof(StorT) <<
00053                        " (" << b << ")");
00054             Process::MemoryInfo::PrintUsage("At out of memory");
00055         }
00056         void* vp = p;
00057         ILOG_DEBUG("Alloc (0x" << vp << ") " << n << " times " << sizeof(StorT)
00058                    << ", usage from " << oldMem << " to " << mMemUse);
00059         mMap[p] = SysInf(n, sizeof(StorT), mNrAlloc-1);
00060         return p;
00061     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:17:16 2011 for ImpalaSrc by  doxygen 1.5.1