Transferring loads of array variables from Stack to Heap

This commit is contained in:
Hombre
2011-01-01 03:28:27 +01:00
parent 5ee87be11b
commit 9fa432880c
26 changed files with 190 additions and 72 deletions

View File

@@ -30,9 +30,31 @@ extern Settings* settings;
ImProcCoordinator::ImProcCoordinator ()
: awbComputed(false), ipf(&params, true), scale(10), allocated(false),
pW(-1), pH(-1), plistener(NULL), imageListener(NULL),fineDetailsProcessed(false),
aeListener(NULL), hListener(NULL), resultValid(false),
pW(-1), pH(-1), plistener(NULL),fineDetailsProcessed(false),
imageListener(NULL), aeListener(NULL), hListener(NULL), resultValid(false),
changeSinceLast(0), updaterRunning(false), destroying(false) {
dummy1 = new float[65536];
dummy2 = new float[65536];
hltonecurve = new float[65536];
shtonecurve = new float[65536];
tonecurve = new int[65536];
lumacurve = new int[65536];
chroma_acurve = new int[65536];
chroma_bcurve = new int[65536];
vhist16 = new unsigned int[65536];
lhist16 = new unsigned int[65536];
rhist = new unsigned int[256];
ghist = new unsigned int[256];
bhist = new unsigned int[256];
Lhist = new unsigned int[256];
bcrgbhist = new unsigned int[256];
bcLhist = new unsigned int[256];
bcabhist = new unsigned int[256];
}
void ImProcCoordinator::assign (ImageSource* imgsrc) {
@@ -53,6 +75,27 @@ ImProcCoordinator::~ImProcCoordinator () {
for (int i=0; i<toDel.size(); i++)
delete toDel[i];
delete [] dummy1;
delete [] dummy2;
delete [] hltonecurve;
delete [] shtonecurve;
delete [] tonecurve;
delete [] lumacurve;
delete [] chroma_acurve;
delete [] chroma_bcurve;
delete [] vhist16;
delete [] lhist16;
delete [] rhist;
delete [] ghist;
delete [] bhist;
delete [] Lhist;
delete [] bcrgbhist;
delete [] bcLhist;
delete [] bcabhist;
imgsrc->decreaseRef ();
updaterThreadStart.unlock ();
}
@@ -156,11 +199,12 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) {
if (todo & M_AUTOEXP) {
if (params.toneCurve.autoexp) {
unsigned int aehist[65536]; int aehistcompr;
unsigned int *aehist = new unsigned int[65536]; int aehistcompr;
imgsrc->getAEHistogram (aehist, aehistcompr);
ipf.getAutoExp (aehist, aehistcompr, imgsrc->getDefGain(), params.toneCurve.clip, params.toneCurve.expcomp, params.toneCurve.black);
if (aeListener)
aeListener->autoExpChanged (params.toneCurve.expcomp, params.toneCurve.black);
delete [] aehist;
}
}