- Fixed a massive memory leak in Hipadaba

- Extended the Hdb adapter to support SICSdata
- Made the simulated histogram memory driver work properly when
  data has been set.
- Implemented the hfactory command
- Removed hdbcommand which was never finsihed
This commit is contained in:
koennecke
2008-05-08 09:27:48 +00:00
parent 7d2b0c5104
commit e46334eddf
20 changed files with 1167 additions and 901 deletions

View File

@@ -402,7 +402,7 @@ hdbValue MakeHdbText(char *initText){
hdbValue result;
result.dataType = HIPTEXT;
result.v.text = initText;
result.v.text = strdup(initText);
result.arrayLength = strlen(initText);
return result;
}
@@ -854,7 +854,8 @@ int copyHdbValue(hdbValue *source, hdbValue *target){
if(target->v.intArray == NULL){
return 0;
}
memset(target->v.intArray,0,source->arrayLength * sizeof(int));
memset(target->v.intArray,0,source->arrayLength
* sizeof(int));
target->arrayLength = source->arrayLength;
}
if(source->v.intArray != NULL){
@@ -865,15 +866,18 @@ int copyHdbValue(hdbValue *source, hdbValue *target){
break;
case HIPFLOATAR:
case HIPFLOATVARAR:
if(target->arrayLength != source->arrayLength || target->v.floatArray == NULL){
if(target->arrayLength != source->arrayLength
|| target->v.floatArray == NULL){
if(target->v.floatArray != NULL){
free(target->v.floatArray);
}
target->v.floatArray = malloc(source->arrayLength * sizeof(double));
target->v.floatArray =
malloc(source->arrayLength * sizeof(double));
if(target->v.floatArray == NULL){
return 0;
}
memset(target->v.floatArray,0,source->arrayLength * sizeof(double));
memset(target->v.floatArray,0,source->arrayLength *
sizeof(double));
target->arrayLength = source->arrayLength;
}
if(source->v.floatArray != NULL){