Transferring loads of array variables from Stack to Heap

This commit is contained in:
Hombre
2010-12-27 12:47:45 +01:00
parent 69284246b1
commit 6152b5d9dd
26 changed files with 192 additions and 73 deletions

View File

@@ -61,20 +61,21 @@ using namespace procparams;
extern const Settings* settings;
int* ImProcFunctions::cacheL;
int* ImProcFunctions::cachea;
int* ImProcFunctions::cacheb;
int* ImProcFunctions::xcache;
int* ImProcFunctions::ycache;
int* ImProcFunctions::zcache;
unsigned short ImProcFunctions::gamma2curve[65536];
int* ImProcFunctions::cacheL = 0;
int* ImProcFunctions::cachea = 0;
int* ImProcFunctions::cacheb = 0;
int* ImProcFunctions::xcache = 0;
int* ImProcFunctions::ycache = 0;
int* ImProcFunctions::zcache = 0;
unsigned short* ImProcFunctions::gamma2curve = 0;
void ImProcFunctions::initCache () {
int maxindex = 2*65536;
const int maxindex = 2*65536;
cacheL = new int[maxindex];
cachea = new int[maxindex];
cacheb = new int[maxindex];
gamma2curve = new unsigned short[65536];
int threshold = (int)(0.008856*CMAXVAL);
for (int i=0; i<maxindex; i++)
@@ -112,6 +113,17 @@ void ImProcFunctions::initCache () {
}
}
void ImProcFunctions::cleanupCache () {
delete [] cacheL;
delete [] cachea;
delete [] cacheb;
delete [] xcache;
delete [] ycache;
delete [] zcache;
delete [] gamma2curve;
}
ImProcFunctions::~ImProcFunctions () {
if (monitorTransform!=NULL)