test_mblock ok

pull/5/head
yuqing 2016-01-14 13:35:10 +08:00
parent 0fc9297155
commit bb57593f14
3 changed files with 8 additions and 2 deletions

View File

@ -436,7 +436,7 @@ int get_processes(struct fast_process_info **processes, int *count)
break; break;
} }
} }
if (i < len) if (i < len) //not digital string
{ {
continue; continue;
} }

View File

@ -48,7 +48,7 @@ extern "C" {
#ifdef OS_LINUX #ifdef OS_LINUX
typedef struct fast_process_info { typedef struct fast_process_info {
int field_count; int field_count; //field count in /proc/$pid/stat
int pid; int pid;
char comm[128]; char comm[128];
char state; char state;

View File

@ -85,6 +85,7 @@ int main(int argc, char *argv[])
stats[i].f_ffree); stats[i].f_ffree);
} }
#ifdef OS_LINUX
{ {
FastProcessInfo *processes; FastProcessInfo *processes;
get_processes(&processes, &count); get_processes(&processes, &count);
@ -93,7 +94,12 @@ int main(int argc, char *argv[])
{ {
printf("%d %d %c %s\n", processes[i].field_count, processes[i].pid, processes[i].state, processes[i].comm); printf("%d %d %c %s\n", processes[i].field_count, processes[i].pid, processes[i].state, processes[i].comm);
} }
if (processes != NULL)
{
free(processes);
}
} }
#endif
//iniPrintItems(&iniContext); //iniPrintItems(&iniContext);
iniFreeContext(&iniContext); iniFreeContext(&iniContext);