Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Change-Id: Ibf3c06619ef296df5c49f3945cb6428777781d69
  • Loading branch information
liangfu committed Mar 26, 2020
1 parent 3bb1a95 commit 30e19c7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/runtime/crt/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <tvm/runtime/crt/logging.h>
#include <tvm/runtime/crt/memory.h>

#include <inttypes.h>

/*! Number of bits in a page */
#define TVM_CRT_PAGE_BITS (TVM_CRT_PAGE_BYTES << 3)

Expand Down Expand Up @@ -223,8 +225,8 @@ void* MemoryManager_Alloc(MemoryManager * mgr, tvm_index_t size) {
} else {
PageTable * ptable = &(mgr->ptable);
start = ptable->count;
CHECK_LE((start + npage), (sizeof(g_memory_pool) / kPageSize),
"insufficient memory, start=%ld, npage=%ld, total=%ld",
CHECK_LE((unsigned)(start + npage), (sizeof(g_memory_pool) / kPageSize),
"insufficient memory, start=%" PRId64 ", npage=%" PRId64 ", total=%" PRId64 "",
start, npage, start + npage);
/* insert page entry */
Page p = PageCreate(start, npage);
Expand Down Expand Up @@ -274,8 +276,8 @@ void* MemoryManager_Realloc(MemoryManager * mgr, void * ptr, tvm_index_t size) {
free_map->erase(free_map, it);
} else {
start = ptable->count;
CHECK_LE((start + npage), (sizeof(g_memory_pool) / kPageSize),
"insufficient memory, start=%ld, npage=%ld, total=%ld",
CHECK_LE((unsigned)(start + npage), (sizeof(g_memory_pool) / kPageSize),
"insufficient memory, start=%" PRId64 ", npage=%" PRId64 ", total=%" PRId64 "",
start, npage, start + npage);
Page p = PageCreate(start, npage);
ptable->resize(ptable, start + npage, &p);
Expand All @@ -300,8 +302,8 @@ void* MemoryManager_Realloc(MemoryManager * mgr, void * ptr, tvm_index_t size) {
} else {
PageTable * ptable = &(mgr->ptable);
start = ptable->count;
CHECK_LE((start + npage), (sizeof(g_memory_pool) / kPageSize),
"insufficient memory, start=%ld, npage=%ld, total=%ld",
CHECK_LE((unsigned)(start + npage), (sizeof(g_memory_pool) / kPageSize),
"insufficient memory, start=%" PRId64 ", npage=%" PRId64 ", total=%" PRId64 "",
start, npage, start + npage);
/* insert page entry */
Page p = PageCreate(start, npage);
Expand Down

0 comments on commit 30e19c7

Please sign in to comment.