devices/*, USE_OMP, cleanup 'InstanceArray' usage
store 'InstanceArray' in the very first module only, NULL it in any other. FREE() it in every module to treat them all the same in XXXdestroy()
This commit is contained in:
parent
79919ed069
commit
d7abe962e0
|
|
@ -18,11 +18,6 @@ BSIM3destroy(GENmodel **inModel)
|
||||||
{
|
{
|
||||||
BSIM3model *mod = *(BSIM3model**) inModel;
|
BSIM3model *mod = *(BSIM3model**) inModel;
|
||||||
|
|
||||||
#ifdef USE_OMP
|
|
||||||
/* free just once for all models */
|
|
||||||
FREE(mod->BSIM3InstanceArray);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
BSIM3model *next_mod = BSIM3nextModel(mod);
|
BSIM3model *next_mod = BSIM3nextModel(mod);
|
||||||
BSIM3instance *inst = BSIM3instances(mod);
|
BSIM3instance *inst = BSIM3instances(mod);
|
||||||
|
|
@ -42,6 +37,10 @@ BSIM3destroy(GENmodel **inModel)
|
||||||
inst = next_inst;
|
inst = next_inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_OMP
|
||||||
|
FREE(mod->BSIM3InstanceArray);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* mod->BSIM3modName to be freed in INPtabEnd() */
|
/* mod->BSIM3modName to be freed in INPtabEnd() */
|
||||||
FREE(mod->BSIM3version);
|
FREE(mod->BSIM3version);
|
||||||
GENmodelFree(GENmodelOf(mod));
|
GENmodelFree(GENmodelOf(mod));
|
||||||
|
|
|
||||||
|
|
@ -1137,9 +1137,14 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
||||||
{
|
{
|
||||||
InstCount++;
|
InstCount++;
|
||||||
}
|
}
|
||||||
|
model->BSIM3InstCount = 0;
|
||||||
|
model->BSIM3InstanceArray = NULL;
|
||||||
}
|
}
|
||||||
InstArray = TMALLOC(BSIM3instance*, InstCount);
|
InstArray = TMALLOC(BSIM3instance*, InstCount);
|
||||||
model = (BSIM3model*)inModel;
|
model = (BSIM3model*)inModel;
|
||||||
|
/* store this in the first model only */
|
||||||
|
model->BSIM3InstCount = InstCount;
|
||||||
|
model->BSIM3InstanceArray = InstArray;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
for( ; model != NULL; model = BSIM3nextModel(model) )
|
for( ; model != NULL; model = BSIM3nextModel(model) )
|
||||||
{
|
{
|
||||||
|
|
@ -1150,9 +1155,6 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
||||||
InstArray[idx] = here;
|
InstArray[idx] = here;
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
/* set the array pointer and instance count into each model */
|
|
||||||
model->BSIM3InstCount = InstCount;
|
|
||||||
model->BSIM3InstanceArray = InstArray;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,6 @@ BSIM3v32destroy (GENmodel **inModel)
|
||||||
{
|
{
|
||||||
BSIM3v32model *mod = *(BSIM3v32model**) inModel;
|
BSIM3v32model *mod = *(BSIM3v32model**) inModel;
|
||||||
|
|
||||||
#ifdef USE_OMP
|
|
||||||
/* free just once for all models */
|
|
||||||
FREE(mod->BSIM3v32InstanceArray);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
BSIM3v32model *next_mod = BSIM3v32nextModel(mod);
|
BSIM3v32model *next_mod = BSIM3v32nextModel(mod);
|
||||||
BSIM3v32instance *inst = BSIM3v32instances(mod);
|
BSIM3v32instance *inst = BSIM3v32instances(mod);
|
||||||
|
|
@ -40,6 +35,11 @@ BSIM3v32destroy (GENmodel **inModel)
|
||||||
GENinstanceFree(GENinstanceOf(inst));
|
GENinstanceFree(GENinstanceOf(inst));
|
||||||
inst = next_inst;
|
inst = next_inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_OMP
|
||||||
|
FREE(mod->BSIM3v32InstanceArray);
|
||||||
|
#endif
|
||||||
|
|
||||||
FREE(mod->BSIM3v32version);
|
FREE(mod->BSIM3v32version);
|
||||||
GENmodelFree(GENmodelOf(mod));
|
GENmodelFree(GENmodelOf(mod));
|
||||||
mod = next_mod;
|
mod = next_mod;
|
||||||
|
|
|
||||||
|
|
@ -1149,9 +1149,14 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
||||||
{
|
{
|
||||||
InstCount++;
|
InstCount++;
|
||||||
}
|
}
|
||||||
|
model->BSIM3v32InstCount = 0;
|
||||||
|
model->BSIM3v32InstanceArray = NULL;
|
||||||
}
|
}
|
||||||
InstArray = TMALLOC(BSIM3v32instance*, InstCount);
|
InstArray = TMALLOC(BSIM3v32instance*, InstCount);
|
||||||
model = (BSIM3v32model*)inModel;
|
model = (BSIM3v32model*)inModel;
|
||||||
|
/* store this in the first model only */
|
||||||
|
model->BSIM3v32InstCount = InstCount;
|
||||||
|
model->BSIM3v32InstanceArray = InstArray;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
for (; model != NULL; model = BSIM3v32nextModel(model))
|
for (; model != NULL; model = BSIM3v32nextModel(model))
|
||||||
{
|
{
|
||||||
|
|
@ -1162,9 +1167,6 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
||||||
InstArray[idx] = here;
|
InstArray[idx] = here;
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
/* set the array pointer and instance count into each model */
|
|
||||||
model->BSIM3v32InstCount = InstCount;
|
|
||||||
model->BSIM3v32InstanceArray = InstArray;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -68,11 +68,6 @@ BSIM4destroy(GENmodel **inModel)
|
||||||
{
|
{
|
||||||
BSIM4model *mod = *(BSIM4model**) inModel;
|
BSIM4model *mod = *(BSIM4model**) inModel;
|
||||||
|
|
||||||
#ifdef USE_OMP
|
|
||||||
/* free just once for all models */
|
|
||||||
FREE(mod->BSIM4InstanceArray);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
BSIM4model *next_mod = BSIM4nextModel(mod);
|
BSIM4model *next_mod = BSIM4nextModel(mod);
|
||||||
BSIM4instance *inst = BSIM4instances(mod);
|
BSIM4instance *inst = BSIM4instances(mod);
|
||||||
|
|
@ -89,6 +84,11 @@ BSIM4destroy(GENmodel **inModel)
|
||||||
GENinstanceFree(GENinstanceOf(inst));
|
GENinstanceFree(GENinstanceOf(inst));
|
||||||
inst = next_inst;
|
inst = next_inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_OMP
|
||||||
|
FREE(mod->BSIM4InstanceArray);
|
||||||
|
#endif
|
||||||
|
|
||||||
FREE(mod->BSIM4version);
|
FREE(mod->BSIM4version);
|
||||||
GENmodelFree(GENmodelOf(mod));
|
GENmodelFree(GENmodelOf(mod));
|
||||||
mod = next_mod;
|
mod = next_mod;
|
||||||
|
|
|
||||||
|
|
@ -2728,9 +2728,14 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL
|
||||||
{
|
{
|
||||||
InstCount++;
|
InstCount++;
|
||||||
}
|
}
|
||||||
|
model->BSIM4InstCount = 0;
|
||||||
|
model->BSIM4InstanceArray = NULL;
|
||||||
}
|
}
|
||||||
InstArray = TMALLOC(BSIM4instance*, InstCount);
|
InstArray = TMALLOC(BSIM4instance*, InstCount);
|
||||||
model = (BSIM4model*)inModel;
|
model = (BSIM4model*)inModel;
|
||||||
|
/* store this in the first model only */
|
||||||
|
model->BSIM4InstCount = InstCount;
|
||||||
|
model->BSIM4InstanceArray = InstArray;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
for( ; model != NULL; model = BSIM4nextModel(model) )
|
for( ; model != NULL; model = BSIM4nextModel(model) )
|
||||||
{
|
{
|
||||||
|
|
@ -2741,9 +2746,6 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL
|
||||||
InstArray[idx] = here;
|
InstArray[idx] = here;
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
/* set the array pointer and instance count into each model */
|
|
||||||
model->BSIM4InstCount = InstCount;
|
|
||||||
model->BSIM4InstanceArray = InstArray;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,6 @@ BSIM4v5destroy(GENmodel **inModel)
|
||||||
{
|
{
|
||||||
BSIM4v5model *mod = *(BSIM4v5model**) inModel;
|
BSIM4v5model *mod = *(BSIM4v5model**) inModel;
|
||||||
|
|
||||||
#ifdef USE_OMP
|
|
||||||
/* free just once for all models */
|
|
||||||
FREE(mod->BSIM4v5InstanceArray);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
BSIM4v5model *next_mod = BSIM4v5nextModel(mod);
|
BSIM4v5model *next_mod = BSIM4v5nextModel(mod);
|
||||||
BSIM4v5instance *inst = BSIM4v5instances(mod);
|
BSIM4v5instance *inst = BSIM4v5instances(mod);
|
||||||
|
|
@ -39,6 +34,11 @@ BSIM4v5destroy(GENmodel **inModel)
|
||||||
GENinstanceFree(GENinstanceOf(inst));
|
GENinstanceFree(GENinstanceOf(inst));
|
||||||
inst = next_inst;
|
inst = next_inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_OMP
|
||||||
|
FREE(mod->BSIM4v5InstanceArray);
|
||||||
|
#endif
|
||||||
|
|
||||||
FREE(mod->BSIM4v5version);
|
FREE(mod->BSIM4v5version);
|
||||||
GENmodelFree(GENmodelOf(mod));
|
GENmodelFree(GENmodelOf(mod));
|
||||||
mod = next_mod;
|
mod = next_mod;
|
||||||
|
|
|
||||||
|
|
@ -2106,9 +2106,14 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
||||||
{
|
{
|
||||||
InstCount++;
|
InstCount++;
|
||||||
}
|
}
|
||||||
|
model->BSIM4v5InstCount = 0;
|
||||||
|
model->BSIM4v5InstanceArray = NULL;
|
||||||
}
|
}
|
||||||
InstArray = TMALLOC(BSIM4v5instance*, InstCount);
|
InstArray = TMALLOC(BSIM4v5instance*, InstCount);
|
||||||
model = (BSIM4v5model*)inModel;
|
model = (BSIM4v5model*)inModel;
|
||||||
|
/* store this in the first model only */
|
||||||
|
model->BSIM4v5InstCount = InstCount;
|
||||||
|
model->BSIM4v5InstanceArray = InstArray;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
for (; model != NULL; model = BSIM4v5nextModel(model))
|
for (; model != NULL; model = BSIM4v5nextModel(model))
|
||||||
{
|
{
|
||||||
|
|
@ -2119,9 +2124,6 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
||||||
InstArray[idx] = here;
|
InstArray[idx] = here;
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
/* set the array pointer and instance count into each model */
|
|
||||||
model->BSIM4v5InstCount = InstCount;
|
|
||||||
model->BSIM4v5InstanceArray = InstArray;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,6 @@ BSIM4v6destroy(GENmodel **inModel)
|
||||||
{
|
{
|
||||||
BSIM4v6model *mod = *(BSIM4v6model**) inModel;
|
BSIM4v6model *mod = *(BSIM4v6model**) inModel;
|
||||||
|
|
||||||
#ifdef USE_OMP
|
|
||||||
/* free just once for all models */
|
|
||||||
FREE(mod->BSIM4v6InstanceArray);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
BSIM4v6model *next_mod = BSIM4v6nextModel(mod);
|
BSIM4v6model *next_mod = BSIM4v6nextModel(mod);
|
||||||
BSIM4v6instance *inst = BSIM4v6instances(mod);
|
BSIM4v6instance *inst = BSIM4v6instances(mod);
|
||||||
|
|
@ -41,6 +36,11 @@ BSIM4v6destroy(GENmodel **inModel)
|
||||||
GENinstanceFree(GENinstanceOf(inst));
|
GENinstanceFree(GENinstanceOf(inst));
|
||||||
inst = next_inst;
|
inst = next_inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_OMP
|
||||||
|
FREE(mod->BSIM4v6InstanceArray);
|
||||||
|
#endif
|
||||||
|
|
||||||
FREE(mod->BSIM4v6version);
|
FREE(mod->BSIM4v6version);
|
||||||
GENmodelFree(GENmodelOf(mod));
|
GENmodelFree(GENmodelOf(mod));
|
||||||
mod = next_mod;
|
mod = next_mod;
|
||||||
|
|
|
||||||
|
|
@ -2441,9 +2441,14 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
||||||
{
|
{
|
||||||
InstCount++;
|
InstCount++;
|
||||||
}
|
}
|
||||||
|
model->BSIM4v6InstCount = 0;
|
||||||
|
model->BSIM4v6InstanceArray = NULL;
|
||||||
}
|
}
|
||||||
InstArray = TMALLOC(BSIM4v6instance*, InstCount);
|
InstArray = TMALLOC(BSIM4v6instance*, InstCount);
|
||||||
model = (BSIM4v6model*)inModel;
|
model = (BSIM4v6model*)inModel;
|
||||||
|
/* store this in the first model only */
|
||||||
|
model->BSIM4v6InstCount = InstCount;
|
||||||
|
model->BSIM4v6InstanceArray = InstArray;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
for( ; model != NULL; model = BSIM4v6nextModel(model) )
|
for( ; model != NULL; model = BSIM4v6nextModel(model) )
|
||||||
{
|
{
|
||||||
|
|
@ -2454,9 +2459,6 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
||||||
InstArray[idx] = here;
|
InstArray[idx] = here;
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
/* set the array pointer and instance count into each model */
|
|
||||||
model->BSIM4v6InstCount = InstCount;
|
|
||||||
model->BSIM4v6InstanceArray = InstArray;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,6 @@ BSIM4v7destroy(GENmodel **inModel)
|
||||||
{
|
{
|
||||||
BSIM4v7model *mod = *(BSIM4v7model**) inModel;
|
BSIM4v7model *mod = *(BSIM4v7model**) inModel;
|
||||||
|
|
||||||
#ifdef USE_OMP
|
|
||||||
/* free just once for all models */
|
|
||||||
FREE(mod->BSIM4v7InstanceArray);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
BSIM4v7model *next_mod = BSIM4v7nextModel(mod);
|
BSIM4v7model *next_mod = BSIM4v7nextModel(mod);
|
||||||
BSIM4v7instance *inst = BSIM4v7instances(mod);
|
BSIM4v7instance *inst = BSIM4v7instances(mod);
|
||||||
|
|
@ -41,6 +36,11 @@ BSIM4v7destroy(GENmodel **inModel)
|
||||||
GENinstanceFree(GENinstanceOf(inst));
|
GENinstanceFree(GENinstanceOf(inst));
|
||||||
inst = next_inst;
|
inst = next_inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_OMP
|
||||||
|
FREE(mod->BSIM4v7InstanceArray);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* mod->BSIM4v7modName to be freed in INPtabEnd() */
|
/* mod->BSIM4v7modName to be freed in INPtabEnd() */
|
||||||
FREE(mod->BSIM4v7version);
|
FREE(mod->BSIM4v7version);
|
||||||
GENmodelFree(GENmodelOf(mod));
|
GENmodelFree(GENmodelOf(mod));
|
||||||
|
|
|
||||||
|
|
@ -2596,9 +2596,14 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL
|
||||||
{
|
{
|
||||||
InstCount++;
|
InstCount++;
|
||||||
}
|
}
|
||||||
|
model->BSIM4v7InstCount = 0;
|
||||||
|
model->BSIM4v7InstanceArray = NULL;
|
||||||
}
|
}
|
||||||
InstArray = TMALLOC(BSIM4v7instance*, InstCount);
|
InstArray = TMALLOC(BSIM4v7instance*, InstCount);
|
||||||
model = (BSIM4v7model*)inModel;
|
model = (BSIM4v7model*)inModel;
|
||||||
|
/* store this in the first model only */
|
||||||
|
model->BSIM4v7InstCount = InstCount;
|
||||||
|
model->BSIM4v7InstanceArray = InstArray;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
for( ; model != NULL; model = BSIM4v7nextModel(model) )
|
for( ; model != NULL; model = BSIM4v7nextModel(model) )
|
||||||
{
|
{
|
||||||
|
|
@ -2609,9 +2614,6 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL
|
||||||
InstArray[idx] = here;
|
InstArray[idx] = here;
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
/* set the array pointer and instance count into each model */
|
|
||||||
model->BSIM4v7InstCount = InstCount;
|
|
||||||
model->BSIM4v7InstanceArray = InstArray;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,6 @@ B4SOIdestroy(GENmodel **inModel)
|
||||||
{
|
{
|
||||||
B4SOImodel *mod = *(B4SOImodel**) inModel;
|
B4SOImodel *mod = *(B4SOImodel**) inModel;
|
||||||
|
|
||||||
#ifdef USE_OMP
|
|
||||||
/* free just once for all models */
|
|
||||||
FREE(mod->B4SOIInstanceArray);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
B4SOImodel *next_mod = B4SOInextModel(mod);
|
B4SOImodel *next_mod = B4SOInextModel(mod);
|
||||||
B4SOIinstance *inst = B4SOIinstances(mod);
|
B4SOIinstance *inst = B4SOIinstances(mod);
|
||||||
|
|
@ -37,6 +32,11 @@ B4SOIdestroy(GENmodel **inModel)
|
||||||
GENinstanceFree(GENinstanceOf(inst));
|
GENinstanceFree(GENinstanceOf(inst));
|
||||||
inst = next_inst;
|
inst = next_inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_OMP
|
||||||
|
FREE(mod->B4SOIInstanceArray);
|
||||||
|
#endif
|
||||||
|
|
||||||
GENmodelFree(GENmodelOf(mod));
|
GENmodelFree(GENmodelOf(mod));
|
||||||
mod = next_mod;
|
mod = next_mod;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2733,9 +2733,14 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL
|
||||||
{
|
{
|
||||||
InstCount++;
|
InstCount++;
|
||||||
}
|
}
|
||||||
|
model->B4SOIInstCount = 0;
|
||||||
|
model->B4SOIInstanceArray = NULL;
|
||||||
}
|
}
|
||||||
InstArray = TMALLOC(B4SOIinstance*, InstCount);
|
InstArray = TMALLOC(B4SOIinstance*, InstCount);
|
||||||
model = (B4SOImodel*)inModel;
|
model = (B4SOImodel*)inModel;
|
||||||
|
/* store this in the first model only */
|
||||||
|
model->B4SOIInstCount = InstCount;
|
||||||
|
model->B4SOIInstanceArray = InstArray;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
for( ; model != NULL; model = B4SOInextModel(model) )
|
for( ; model != NULL; model = B4SOInextModel(model) )
|
||||||
{
|
{
|
||||||
|
|
@ -2746,9 +2751,6 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL
|
||||||
InstArray[idx] = here;
|
InstArray[idx] = here;
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
/* set the array pointer and instance count into each model */
|
|
||||||
model->B4SOIInstCount = InstCount;
|
|
||||||
model->B4SOIInstanceArray = InstArray;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,11 +64,6 @@ HSM2destroy(GENmodel **inModel)
|
||||||
{
|
{
|
||||||
HSM2model *mod = *(HSM2model**) inModel;
|
HSM2model *mod = *(HSM2model**) inModel;
|
||||||
|
|
||||||
#ifdef USE_OMP
|
|
||||||
/* free just once for all models */
|
|
||||||
FREE(mod->HSM2InstanceArray);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (mod) {
|
while (mod) {
|
||||||
HSM2model *next_mod = HSM2nextModel(mod);
|
HSM2model *next_mod = HSM2nextModel(mod);
|
||||||
HSM2instance *inst = HSM2instances(mod);
|
HSM2instance *inst = HSM2instances(mod);
|
||||||
|
|
@ -77,6 +72,11 @@ HSM2destroy(GENmodel **inModel)
|
||||||
GENinstanceFree(GENinstanceOf(inst));
|
GENinstanceFree(GENinstanceOf(inst));
|
||||||
inst = next_inst;
|
inst = next_inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_OMP
|
||||||
|
FREE(mod->HSM2InstanceArray);
|
||||||
|
#endif
|
||||||
|
|
||||||
GENmodelFree(GENmodelOf(mod));
|
GENmodelFree(GENmodelOf(mod));
|
||||||
mod = next_mod;
|
mod = next_mod;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1275,9 +1275,14 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL
|
||||||
{
|
{
|
||||||
InstCount++;
|
InstCount++;
|
||||||
}
|
}
|
||||||
|
model->HSM2InstCount = 0;
|
||||||
|
model->HSM2InstanceArray = NULL;
|
||||||
}
|
}
|
||||||
InstArray = TMALLOC(HSM2instance*, InstCount);
|
InstArray = TMALLOC(HSM2instance*, InstCount);
|
||||||
model = (HSM2model*)inModel;
|
model = (HSM2model*)inModel;
|
||||||
|
/* store this in the first model only */
|
||||||
|
model->HSM2InstCount = InstCount;
|
||||||
|
model->HSM2InstanceArray = InstArray;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
for ( ; model != NULL; model = HSM2nextModel(model) )
|
for ( ; model != NULL; model = HSM2nextModel(model) )
|
||||||
{
|
{
|
||||||
|
|
@ -1288,9 +1293,6 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL
|
||||||
InstArray[idx] = here;
|
InstArray[idx] = here;
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
/* set the array pointer and instance count into each model */
|
|
||||||
model->HSM2InstCount = InstCount;
|
|
||||||
model->HSM2InstanceArray = InstArray;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue