소스 검색

Fix integer size

Samuel Thibault 7 년 전
부모
커밋
19d69406bc
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      src/core/jobs.c

+ 3 - 3
src/core/jobs.c

@@ -33,7 +33,7 @@
 #include <limits.h>
 
 static int max_memory_use;
-static int njobs, maxnjobs;
+static unsigned long njobs, maxnjobs;
 
 #ifdef STARPU_DEBUG
 /* List of all jobs, for debugging */
@@ -53,7 +53,7 @@ void _starpu_job_fini(void)
 {
 	if (max_memory_use)
 	{
-		_STARPU_DISP("Memory used for %d tasks: %lu MiB\n", maxnjobs, (unsigned long) (maxnjobs * (sizeof(struct starpu_task) + sizeof(struct _starpu_job))) >> 20);
+		_STARPU_DISP("Memory used for %lu tasks: %lu MiB\n", maxnjobs, (unsigned long) (maxnjobs * (sizeof(struct starpu_task) + sizeof(struct _starpu_job))) >> 20);
 		STARPU_ASSERT_MSG(njobs == 0, "Some tasks have not been cleaned, did you forget to call starpu_task_destroy or starpu_task_clean?");
 	}
 }
@@ -97,7 +97,7 @@ struct _starpu_job* STARPU_ATTRIBUTE_MALLOC _starpu_job_create(struct starpu_tas
 	}
 	if (max_memory_use)
 	{
-		int jobs = STARPU_ATOMIC_ADDL(&njobs, 1);
+		unsigned long jobs = STARPU_ATOMIC_ADDL(&njobs, 1);
 		if (jobs > maxnjobs)
 			maxnjobs = jobs;
 	}