void x_ipc_dataMsgDisplayStats(FILE *stream) { LOCK_M_MUTEX; fprintf(stream,"Data Msg Buffer Stats:\n"); fprintf(stream," Total Alloc : %d\n", GET_M_GLOBAL(DMTotal)); fprintf(stream," Total Freed : %d\n", GET_M_GLOBAL(DMFree)); fprintf(stream," Min Request : %d\n", GET_M_GLOBAL(DMmin)); fprintf(stream," Max Request : %d\n", GET_M_GLOBAL(DMmax)); #if 0 fprintf(stream,"Buf List Size: %d\n", x_ipc_listLength(GET_M_GLOBAL(dataMsgBufferList))); GET_M_GLOBAL(numAllocatedDM) = GET_M_GLOBAL(sizeDM) = 0; x_ipc_listIterateFromFirst((LIST_ITER_FN)countDataMessages, (char *)TRUE, (GET_M_GLOBAL(dataMsgBufferList))); fprintf(stream," %d allocated, with %d total bytes\n", GET_M_GLOBAL(numAllocatedDM), GET_M_GLOBAL(sizeDM)); GET_M_GLOBAL(numAllocatedDM) = GET_M_GLOBAL(sizeDM) = 0; x_ipc_listIterateFromFirst((LIST_ITER_FN)countDataMessages, FALSE, (GET_M_GLOBAL(dataMsgBufferList))); fprintf(stream," %d deallocated, with %d total bytes\n", GET_M_GLOBAL(numAllocatedDM), GET_M_GLOBAL(sizeDM)); #endif UNLOCK_M_MUTEX; FLUSH_IF_NEEDED(stream); }
void x_ipcModWarning(const char *description, ...) { #ifdef NMP_IPC if (ipcVerbosity >= IPC_Print_Warnings) #endif if (description) { va_list args; va_start(args, description); vfprintf(stderr, (char *)description, args); va_end(args); FLUSH_IF_NEEDED(stderr); } }
void x_ipcModError(const char *description, ...) { #ifndef NMP_IPC x_ipcStats(stderr); #endif #ifdef NMP_IPC if (ipcVerbosity >= IPC_Print_Errors) #endif if (description) { va_list args; va_start(args, description); vfprintf(stderr, (char *)description, args); fprintf(stderr, "\n"); va_end(args); FLUSH_IF_NEEDED(stderr); } #ifdef NMP_IPC if (ipcVerbosity >= IPC_Exit_On_Errors) #endif { x_ipcClose(); LOCK_M_MUTEX; if (mGlobalp()) { #ifdef LISP if (IS_LISP_MODULE()) { if (GET_M_GLOBAL(lispExitGlobal) != NULL) (*(GET_M_GLOBAL(lispExitGlobal)))(); } else #endif /* LISP */ { if (GET_M_GLOBAL(x_ipcExitHnd)) { (*(GET_M_GLOBAL(x_ipcExitHnd)))(); } else { exit(-1); } } } UNLOCK_M_MUTEX; } }