Index: generic/nsfProfile.c =================================================================== diff -u -ra963e8896fd07c345ccfa034cbd043344edbf083 -r1f532a9dd165fbbf7f3a3f470f7661acf4c35fad --- generic/nsfProfile.c (.../nsfProfile.c) (revision a963e8896fd07c345ccfa034cbd043344edbf083) +++ generic/nsfProfile.c (.../nsfProfile.c) (revision 1f532a9dd165fbbf7f3a3f470f7661acf4c35fad) @@ -756,14 +756,17 @@ */ void NsfProfileRecordProcData(Tcl_Interp *interp, const char *methodName, long startSec, long startUsec) { - NsfRuntimeState *rst = RUNTIME_STATE(interp); - NsfProfile *profilePtr = &rst->profile; - double totalMicroSec; - struct Tcl_Time trt; + NsfRuntimeState *rst; + NsfProfile *profilePtr; + double totalMicroSec; + struct Tcl_Time trt; nonnull_assert(interp != NULL); nonnull_assert(methodName != NULL); + rst = RUNTIME_STATE(interp); + profilePtr = &rst->profile; + Tcl_GetTime(&trt); totalMicroSec = (double)((trt.sec - startSec) * 1000000 + (trt.usec - startUsec)); @@ -827,11 +830,12 @@ void NsfProfileClearData(Tcl_Interp *interp) { - NsfProfile *profilePtr = &RUNTIME_STATE(interp)->profile; - struct Tcl_Time trt; + NsfProfile *profilePtr; + struct Tcl_Time trt; nonnull_assert(interp != NULL); + profilePtr = &RUNTIME_STATE(interp)->profile; NsfProfileClearTable(&profilePtr->objectData); NsfProfileClearTable(&profilePtr->methodData); NsfProfileClearTable(&profilePtr->procData); @@ -906,12 +910,13 @@ void NsfProfileGetData(Tcl_Interp *interp) { Tcl_Obj *list = Tcl_NewListObj(0, NULL); - NsfProfile *profilePtr = &RUNTIME_STATE(interp)->profile; + NsfProfile *profilePtr; long totalMicroSec; struct Tcl_Time trt; nonnull_assert(interp != NULL); + profilePtr = &RUNTIME_STATE(interp)->profile; Tcl_GetTime(&trt); totalMicroSec = (trt.sec - profilePtr->startSec) * 1000000 + (trt.usec - profilePtr->startUSec); @@ -943,11 +948,12 @@ */ void NsfProfileInit(Tcl_Interp *interp) { - NsfProfile *profilePtr = &RUNTIME_STATE(interp)->profile; + NsfProfile *profilePtr; struct Tcl_Time trt; nonnull_assert(interp != NULL); + profilePtr = &RUNTIME_STATE(interp)->profile; Tcl_InitHashTable(&profilePtr->objectData, TCL_STRING_KEYS); Tcl_InitHashTable(&profilePtr->methodData, TCL_STRING_KEYS); Tcl_InitHashTable(&profilePtr->procData, TCL_STRING_KEYS); @@ -977,10 +983,11 @@ */ void NsfProfileFree(Tcl_Interp *interp) { - NsfProfile *profilePtr = &RUNTIME_STATE(interp)->profile; + NsfProfile *profilePtr; nonnull_assert(interp != NULL); + profilePtr = &RUNTIME_STATE(interp)->profile; NsfProfileClearData(interp); Tcl_DeleteHashTable(&profilePtr->objectData); Tcl_DeleteHashTable(&profilePtr->methodData);