From: Adrian S. <a3s...@us...> - 2005-07-26 11:15:36
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29575 Modified Files: args.c array.c context.c datetime.c enumeration.c providerDrv.c string.c support.c support.h Log Message: Additional cleanup for [ 1245096 ] mem_state set incorrectly by instance:clone() Removed TOOL_MEM_ADD etc defines in support.h Changed MEM_NOT_TRACKED value to -2 - getting better control for memory management Index: support.c =================================================================== RCS file: /cvsroot/sblim/sfcb/support.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- support.c 13 Jul 2005 14:26:02 -0000 1.7 +++ support.c 26 Jul 2005 11:15:26 -0000 1.8 @@ -391,8 +391,8 @@ * Description: * * Calls calloc to get the requested block size, then adds it to - * the control system depending on add, defined as TOOL_MM_ADD and - * TOOL_MM_NO_ADD. + * the control system depending on add, defined as MEM_TRACKED and + * MEM_NOT_TRACKED. */ void *tool_mm_alloc(int add, size_t size) { @@ -405,7 +405,7 @@ } __ALLOC_ERROR(!result); - if (add != TOOL_MM_NO_ADD) { + if (add != MEM_NOT_TRACKED) { tool_mm_add(result); } _SFCB_TRACE(1, ("--- Area: %p size: %d", result, size)); @@ -514,7 +514,7 @@ object = malloc(size); memcpy(object, ptr, size); - if (mode == TOOL_MM_NO_ADD) + if (mode == MEM_NOT_TRACKED) _SFCB_RETURN(object); mt->hc.encObjs[mt->hc.encUsed++] = (Object *) object; @@ -595,7 +595,7 @@ { managed_thread *mt=__memInit(); - if (memId!=MEM_RELEASED) + if (memId!=MEM_RELEASED && memId!=MEM_NOT_TRACKED) mt->hc.memEncObjs[memId-1] = NULL; } Index: array.c =================================================================== RCS file: /cvsroot/sblim/sfcb/array.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- array.c 13 Jun 2005 23:37:31 -0000 1.2 +++ array.c 26 Jul 2005 11:15:26 -0000 1.3 @@ -55,7 +55,7 @@ { struct native_array *a = (struct native_array *) array; - if (a->mem_state == TOOL_MM_NO_ADD) { + if (a->mem_state == MEM_NOT_TRACKED) { int i = a->size; @@ -79,7 +79,7 @@ { CMPIStatus tmp; struct native_array *a = (struct native_array *) array; - struct native_array *new = __new_empty_array(TOOL_MM_NO_ADD, + struct native_array *new = __new_empty_array(MEM_NOT_TRACKED, a->size, a->type, &tmp); @@ -167,7 +167,7 @@ a->data[index].state = 0; a->data[index].value = - (a->mem_state == TOOL_MM_ADD) ? + (a->mem_state == MEM_TRACKED) ? *val : native_clone_CMPIValue(type, val, &rc); return rc; @@ -177,7 +177,7 @@ if (!(a->data[index].state & CMPI_nullValue)) { - __make_NULL(a, index, index, a->mem_state == TOOL_MM_NO_ADD); + __make_NULL(a, index, index, a->mem_state == MEM_NOT_TRACKED); } CMReturn(CMPI_RC_OK); @@ -209,14 +209,14 @@ CMPIStatus rc = {CMPI_RC_OK, NULL}; a->data[index].state = 0; if (opt) a->data[index].value = *val; - else a->data[index].value = ( a->mem_state == TOOL_MM_ADD )? *val: + else a->data[index].value = ( a->mem_state == MEM_TRACKED )? *val: native_clone_CMPIValue ( type, val, &rc ); return rc; } if ( type == CMPI_null ) { if ( ! ( a->data[index].state & CMPI_nullValue ) ) { - __make_NULL ( a, index, index, a->mem_state == TOOL_MM_NO_ADD ); + __make_NULL ( a, index, index, a->mem_state == MEM_NOT_TRACKED ); } CMReturn ( CMPI_RC_OK ); } @@ -254,7 +254,7 @@ if (type == CMPI_null) { if (!(a->data[index].state & CMPI_nullValue)) { - __make_NULL(a, index, index, a->mem_state == TOOL_MM_NO_ADD); + __make_NULL(a, index, index, a->mem_state == MEM_NOT_TRACKED); } CMReturn(CMPI_RC_OK); } @@ -337,7 +337,7 @@ CMPIArray *TrackedCMPIArray(CMPICount size, CMPIType type, CMPIStatus * rc) { - void *array = internal_new_CMPIArray(TOOL_MM_ADD, size, type, rc); + void *array = internal_new_CMPIArray(MEM_TRACKED, size, type, rc); return (CMPIArray *) array; } @@ -350,7 +350,7 @@ CMPIArray *NewCMPIArray(CMPICount size, CMPIType type, CMPIStatus * rc) { - void *array = internal_new_CMPIArray(TOOL_MM_NO_ADD, size, type, rc); + void *array = internal_new_CMPIArray(MEM_NOT_TRACKED, size, type, rc); return (CMPIArray *) array; } @@ -358,7 +358,7 @@ ClObjectHdr * hdr) { void *array = - __new_empty_array(TOOL_MM_NO_ADD, av->value.sint32, av->type, rc); + __new_empty_array(MEM_NOT_TRACKED, av->value.sint32, av->type, rc); int i, m; for (i = 0, m = (int) av->value.sint32; i < m; i++) Index: providerDrv.c =================================================================== RCS file: /cvsroot/sblim/sfcb/providerDrv.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- providerDrv.c 13 Jun 2005 12:50:33 -0000 1.16 +++ providerDrv.c 26 Jul 2005 11:15:26 -0000 1.17 @@ -183,7 +183,7 @@ ProviderInfo *pInfo; CMPIContext *ctx = NULL; - ctx = native_new_CMPIContext(TOOL_MM_ADD,NULL); + ctx = native_new_CMPIContext(MEM_TRACKED,NULL); for (pInfo=curProvProc->firstProv; pInfo; pInfo=pInfo->next) { if (pInfo->classMI) pInfo->classMI->ft->cleanup(pInfo->classMI, ctx); if (pInfo->instanceMI) pInfo->instanceMI->ft->cleanup(pInfo->instanceMI, ctx); @@ -264,7 +264,7 @@ semAcquireUnDo(sfcbSem,(proc->id*3)+provProcGuardId+provProcBaseId); if ((val=semGetValue(sfcbSem,(proc->id*3)+provProcInuseId+provProcBaseId))==0) { if ((now-proc->lastActivity)>provTimeoutInterval) { - ctx = native_new_CMPIContext(TOOL_MM_ADD,NULL); + ctx = native_new_CMPIContext(MEM_TRACKED,NULL); noBreak=0; for (crc.rc=0,pInfo = activProvs; pInfo; pInfo = pInfo->next) { if (pInfo->library==NULL) continue; @@ -712,7 +712,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; @@ -741,7 +741,7 @@ CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIArray *r; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPICount count; BinResponseHdr *resp; CMPIFlags flgs=0; @@ -792,7 +792,7 @@ CMPIConstClass *cls = relocateSerializedConstClass(req->cls.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; @@ -823,7 +823,7 @@ CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIArray *r; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPICount count; BinResponseHdr *resp; CMPIFlags flgs=req->flags; @@ -869,7 +869,7 @@ CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIArray *r; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=req->flags; @@ -904,7 +904,7 @@ CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIArray *r; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPICount count; BinResponseHdr *resp; CMPIFlags flgs=0; @@ -963,7 +963,7 @@ CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIArray *r; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPICount count; BinResponseHdr *resp; CMPIFlags flgs=0; @@ -1008,7 +1008,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; @@ -1040,7 +1040,7 @@ CMPIInstance *inst = relocateSerializedInstance(req->instance.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPIArray *r; CMPICount count; BinResponseHdr *resp; @@ -1081,7 +1081,7 @@ CMPIInstance *inst = relocateSerializedInstance(req->instance.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPICount count; BinResponseHdr *resp; CMPIFlags flgs=0; @@ -1119,7 +1119,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; char **props=NULL; @@ -1155,7 +1155,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; @@ -1239,7 +1239,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; int irc; @@ -1310,7 +1310,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; char **props=NULL; @@ -1349,7 +1349,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; char **props=NULL; @@ -1386,7 +1386,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; @@ -1419,7 +1419,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; @@ -1458,7 +1458,7 @@ NativeSelectExp *se=NULL,*prev=NULL; CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPIFlags flgs=0; int makeActive=0; char *type; @@ -1546,7 +1546,7 @@ NativeSelectExp *se=NULL,**sef=&activFilters; CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPIFlags flgs=0; ctx->ft->addEntry(ctx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32); @@ -1627,7 +1627,7 @@ CMPIInstanceMI *mi = NULL; int rc=0; unsigned int flgs=0; - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); _SFCB_ENTER(TRACE_PROVIDERDRV, "initProvider"); Index: datetime.c =================================================================== RCS file: /cvsroot/sblim/sfcb/datetime.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- datetime.c 18 Jul 2005 20:29:35 -0000 1.4 +++ datetime.c 26 Jul 2005 11:15:26 -0000 1.5 @@ -64,9 +64,9 @@ { struct native_datetime *ndt = (struct native_datetime *) dt; - if (ndt->mem_state == TOOL_MM_NO_ADD) { + if (ndt->mem_state == MEM_NOT_TRACKED) { - ndt->mem_state = TOOL_MM_ADD; + ndt->mem_state = MEM_TRACKED; tool_mm_add(ndt); CMReturn(CMPI_RC_OK); @@ -90,7 +90,7 @@ static CMPIDateTime *__dtft_clone(CMPIDateTime * dt, CMPIStatus * rc) { struct native_datetime *ndt = (struct native_datetime *) dt; - struct native_datetime *new = __new_datetime(TOOL_MM_NO_ADD, + struct native_datetime *new = __new_datetime(MEM_NOT_TRACKED, ndt->msecs, ndt->interval, rc); @@ -212,7 +212,7 @@ The newly allocated object's function table is initialized to point to the native functions in this file. - \param mm_add TOOL_MM_ADD for a regular object, TOOL_MM_NO_ADD for + \param mm_add MEM_TRACKED for a regular object, MEM_NOT_TRACKED for cloned ones \param msecs the binary time to be stored \param interval the interval flag to be stored @@ -273,7 +273,7 @@ msecs = (CMPIUint64) 1000000 *(CMPIUint64) tv.tv_sec + (CMPIUint64) tv.tv_usec; - return (CMPIDateTime *) __new_datetime(TOOL_MM_ADD, msecs, 0, rc); + return (CMPIDateTime *) __new_datetime(MEM_TRACKED, msecs, 0, rc); } @@ -293,7 +293,7 @@ CMPIBoolean interval, CMPIStatus * rc) { - return (CMPIDateTime *) __new_datetime(TOOL_MM_ADD, time, interval, rc); + return (CMPIDateTime *) __new_datetime(MEM_TRACKED, time, interval, rc); } @@ -379,7 +379,7 @@ free(str); return (CMPIDateTime *) - __new_datetime(TOOL_MM_ADD, msecs, interval, rc); + __new_datetime(MEM_TRACKED, msecs, interval, rc); } Index: support.h =================================================================== RCS file: /cvsroot/sblim/sfcb/support.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- support.h 21 Mar 2005 14:22:38 -0000 1.2 +++ support.h 26 Jul 2005 11:15:26 -0000 1.3 @@ -68,15 +68,12 @@ //! States cloned objects, i.e. memory that is not being tracked. -#define TOOL_MM_NO_ADD 0 -#define MEM_NOT_TRACKED 0 +#define MEM_NOT_TRACKED -2 //! States tracked memory objects. -#define TOOL_MM_ADD 1 #define MEM_TRACKED 1 //! States tracked memory objects but already released. -#define TOOL_MM_RELEASED 2 #define MEM_RELEASED -1 //! The initial size of trackable memory pointers per thread. Index: args.c =================================================================== RCS file: /cvsroot/sblim/sfcb/args.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- args.c 17 May 2005 13:04:21 -0000 1.3 +++ args.c 26 Jul 2005 11:15:26 -0000 1.4 @@ -62,7 +62,7 @@ { struct native_args *a = (struct native_args *) args; - if (a->mem_state == TOOL_MM_NO_ADD) { + if (a->mem_state == MEM_NOT_TRACKED) { ClArgsFree((ClArgs *) a->args.hdl); free(args); CMReturn(CMPI_RC_OK); @@ -75,7 +75,7 @@ static CMPIArgs *__aft_clone(CMPIArgs * args, CMPIStatus * rc) { struct native_args *a = (struct native_args *) args; - struct native_args *na = __new_empty_args(TOOL_MM_NO_ADD, rc); + struct native_args *na = __new_empty_args(MEM_NOT_TRACKED, rc); // if (rc->rc == CMPI_RC_OK) { na->args.hdl = ClArgsRebuild((ClArgs *) a->args.hdl, NULL); @@ -202,12 +202,12 @@ CMPIArgs *NewCMPIArgs(CMPIStatus * rc) { - return (CMPIArgs *) __new_empty_args(TOOL_MM_NO_ADD, rc); + return (CMPIArgs *) __new_empty_args(MEM_NOT_TRACKED, rc); } CMPIArgs *TrackedCMPIArgs(CMPIStatus * rc) { - return (CMPIArgs *) __new_empty_args(TOOL_MM_ADD, rc); + return (CMPIArgs *) __new_empty_args(MEM_TRACKED, rc); } unsigned long getArgsSerializedSize(CMPIArgs * args) Index: enumeration.c =================================================================== RCS file: /cvsroot/sblim/sfcb/enumeration.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- enumeration.c 9 Mar 2005 12:25:11 -0000 1.1.1.1 +++ enumeration.c 26 Jul 2005 11:15:26 -0000 1.2 @@ -42,7 +42,7 @@ { struct native_enum *e = (struct native_enum *) enumeration; - if (e->mem_state == TOOL_MM_NO_ADD) { + if (e->mem_state == MEM_NOT_TRACKED) { tool_mm_add(enumeration); return e->data->ft->release(e->data); @@ -66,7 +66,7 @@ return NULL; } - return (CMPIEnumeration *) __new_enumeration(TOOL_MM_NO_ADD, data, rc); + return (CMPIEnumeration *) __new_enumeration(MEM_NOT_TRACKED, data, rc); } @@ -113,7 +113,7 @@ enumeration->enumeration = e; enumeration->mem_state = mm_add; - enumeration->data = (mm_add == TOOL_MM_NO_ADD) ? CMClone(array, rc) : array; + enumeration->data = (mm_add == MEM_NOT_TRACKED) ? CMClone(array, rc) : array; if (rc) CMSetStatus(rc, CMPI_RC_OK); @@ -123,7 +123,7 @@ CMPIEnumeration *native_new_CMPIEnumeration(CMPIArray * array, CMPIStatus * rc) { - return (CMPIEnumeration *) __new_enumeration(TOOL_MM_ADD, array, rc); + return (CMPIEnumeration *) __new_enumeration(MEM_TRACKED, array, rc); } Index: string.c =================================================================== RCS file: /cvsroot/sblim/sfcb/string.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- string.c 9 Mar 2005 12:25:14 -0000 1.1.1.1 +++ string.c 26 Jul 2005 11:15:26 -0000 1.2 @@ -40,7 +40,7 @@ { struct native_string *s = (struct native_string *) string; - if (s->mem_state == TOOL_MM_NO_ADD) { + if (s->mem_state == MEM_NOT_TRACKED) { tool_mm_add(s); tool_mm_add(s->string.hdl); @@ -55,7 +55,7 @@ static CMPIString *__sft_clone(CMPIString * string, CMPIStatus * rc) { return (CMPIString *) - __new_string(TOOL_MM_NO_ADD, string->ft->getCharPtr(string, rc), rc); + __new_string(MEM_NOT_TRACKED, string->ft->getCharPtr(string, rc), rc); } @@ -82,7 +82,7 @@ string->string.ft = &sft; string->mem_state = mm_add; - if (mm_add == TOOL_MM_ADD) { + if (mm_add == MEM_TRACKED) { tool_mm_add(string->string.hdl); } @@ -94,7 +94,7 @@ CMPIString *native_new_CMPIString(const char *ptr, CMPIStatus * rc) { - return (CMPIString *) __new_string(TOOL_MM_ADD, ptr, rc); + return (CMPIString *) __new_string(MEM_TRACKED, ptr, rc); } Index: context.c =================================================================== RCS file: /cvsroot/sblim/sfcb/context.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- context.c 9 Mar 2005 12:25:11 -0000 1.1.1.1 +++ context.c 26 Jul 2005 11:15:26 -0000 1.2 @@ -147,9 +147,9 @@ { struct native_context *c = (struct native_context *) ctx; - if (c->mem_state == TOOL_MM_NO_ADD) { + if (c->mem_state == MEM_NOT_TRACKED) { - c->mem_state = TOOL_MM_ADD; + c->mem_state = MEM_TRACKED; tool_mm_add(c); propertyFT.release(c->entries); @@ -161,7 +161,7 @@ CMPIString *name; struct native_context *c = (struct native_context *) ctx; int i,s; - CMPIContext *nCtx=native_new_CMPIContext(TOOL_MM_NO_ADD,c->data); + CMPIContext *nCtx=native_new_CMPIContext(MEM_NOT_TRACKED,c->data); for (i=0,s=ctx->ft->getEntryCount(ctx,NULL); i<s; i++) { CMPIData data=ctx->ft->getEntryAt(ctx,i,&name,NULL); @@ -230,7 +230,7 @@ tmp->name = strdup ( name ); - if ( mm_add == TOOL_MM_ADD ) tool_mm_add ( tmp->name ); + if ( mm_add == MEM_TRACKED ) tool_mm_add ( tmp->name ); if ( type == CMPI_chars ) { @@ -245,7 +245,7 @@ if ( type != CMPI_null ) { tmp->state = state; - if ( mm_add == TOOL_MM_ADD ) { + if ( mm_add == MEM_TRACKED ) { tmp->value = *value; } else { @@ -303,7 +303,7 @@ if ( type != CMPI_null ) { prop->value = - ( mm_add == TOOL_MM_ADD )? + ( mm_add == MEM_TRACKED )? *value: native_clone_CMPIValue ( type, value, &rc ); @@ -411,7 +411,7 @@ result = (struct native_property * ) - tool_mm_alloc ( TOOL_MM_NO_ADD, + tool_mm_alloc ( MEM_NOT_TRACKED, sizeof ( struct native_property ) ); result->name = strdup ( prop->name ); |