19 m_Max(saver,
this,
"max", 800,
"Maximum Image Memory (MB)"),
20 m_TotalBufferSizeMB32(saver,
this,
"totalBufferSizeMB32", 800,
"Maximum Image Memory in 32 bit system (MB)"),
21 m_TotalBufferSizeMB64(saver,
this,
"totalBufferSizeMB64", 2000,
"Maximum Image Memory in 64 bit system (MB)"),
22 m_Reserve(saver,
this,
"reserve",100,
"Extra Reserved Memory (MB)"),
26 printf(
"Only one allocator can be created\n");
32 printf(
"QcepAllocator::QcepAllocator(%p)\n",
this);
49 printf(
"Deleting allocator\n");
55 printf(
"QcepAllocator::~QcepAllocator(%p)\n",
this);
76 if (get_TotalBufferSizeMB32() > 100000000) {
77 set_TotalBufferSizeMB32(get_TotalBufferSizeMB32()/
MegaBytes);
80 if (get_TotalBufferSizeMB64() > 100000000) {
81 set_TotalBufferSizeMB64(get_TotalBufferSizeMB64()/
MegaBytes);
111 return ((
m_AllocatedMemoryMB.fetchAndAddOrdered(0) + sizeMB) < (get_Max() + get_Reserve()));
127 res->moveToThread(NULL);
152 res->moveToThread(NULL);
177 res -> moveToThread(NULL);
203 img->moveToThread(NULL);
218 res->moveToThread(NULL);
247 res->moveToThread(NULL);
272 integ->set_Name(name);
273 integ->moveToThread(NULL);
292 img->moveToThread(NULL);
293 integ->moveToThread(NULL);
311 g_Allocator ->
allocate((quint64) sz*width*height);
336 g_Allocator ->
deallocate((quint64) sz*width*height);
359 return sizeof(quint16)*width*height/
MegaBytes;
364 return sizeof(quint32)*width*height/
MegaBytes;
369 return sizeof(double)*width*height/
MegaBytes;
374 return sizeof(quint16)*width*height/
MegaBytes;
379 return (
sizeof(
double)*4*nrows)/
MegaBytes;
QcepImageData< double > QcepDoubleImageData
static void deallocate(int sz, int width, int height)
QcepImageData< quint16 > QcepInt16ImageData
static QcepIntegratedDataPtr newIntegratedData(AllocationStrategy strat, QcepDoubleImageDataPtr image, QcepObject *parent)
void readSettings(QSettings *settings, QString section)
qint64 qcepDebug(int cond)
int int16SizeMB(int width, int height)
virtual void readSettings(QSettings *set, QString section)
QcepAllocator(QcepSettingsSaverPtr saver)
void changedSizeMB(int newMB)
static void newDoubleImageAndIntegratedData(AllocationStrategy strat, int width, int height, QcepObject *parent, QcepDoubleImageDataPtr &img, QcepIntegratedDataPtr &integ)
QSharedPointer< QcepIntegratedData > QcepIntegratedDataPtr
static quint64 allocatedMemory()
static void msleep(long unsigned int)
int int32SizeMB(int width, int height)
void writeSettings(QSettings *settings, QString section)
static QcepDoubleImageDataPtr newDoubleImage(AllocationStrategy strat, int width, int height, QcepObject *parent)
QcepImageData< quint32 > QcepInt32ImageData
static QcepAllocator * g_Allocator
int doubleSizeMB(int width, int height)
int maskSizeMB(int width, int height)
double allocatedMemoryMB()
QSharedPointer< QcepSettingsSaver > QcepSettingsSaverPtr
QcepObject(QString name, QcepObject *parent)
int waitTillAvailable(AllocationStrategy strat, int sizeMB)
QAtomicInt m_AllocatedMemoryMB
void allocatorHeartbeat()
static void allocate(int sz, int width, int height)
virtual void writeSettings(QSettings *set, QString section)
static QcepInt16ImageDataPtr newInt16Image(AllocationStrategy strat, int width, int height, QcepObject *parent)
virtual void printMessage(QString msg, QDateTime ts=QDateTime::currentDateTime())=0
QSharedPointer< QcepInt32ImageData > QcepInt32ImageDataPtr
QcepApplication * g_Application
int integratedSizeMB(int nrows)
static quint64 g_AllocatedMemory
static QcepMaskDataPtr newMask(AllocationStrategy strat, int width, int height, int def, QcepObject *parent)
void allocateBytes(quint64 amt)
QSharedPointer< QcepInt16ImageData > QcepInt16ImageDataPtr
QSharedPointer< QcepMaskData > QcepMaskDataPtr
static QcepInt32ImageDataPtr newInt32Image(AllocationStrategy strat, int width, int height, QcepObject *parent)
void deallocateBytes(quint64 amt)
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr