提交 bf85d4c7 编写于 作者: Fa_wang's avatar Fa_wang

compress.cpp

上级 8063507f
......@@ -74,7 +74,7 @@ long readFromGz(void* ptr, const char *file_name, long buf_size, uint8_t load_ty
while (curr_size < buf_size) {
uint32_t bytes_read = gzread(compressed_mem, temp_page, chunk_size);
if (bytes_read == 0) { break; }
if (bytes_read == 0) { printf("Hello\n"); break; }
assert(load_type != LOAD_RAM || bytes_read % sizeof(long) == 0);
for (uint32_t x = 0; x < bytes_read / sizeof(long) + 1; x++) {
if (*(temp_page + x) != 0) {
......@@ -84,6 +84,11 @@ long readFromGz(void* ptr, const char *file_name, long buf_size, uint8_t load_ty
}
curr_size += bytes_read;
}
if(gzread(compressed_mem, temp_page, chunk_size) > 0) {
printf("File size is larger than RAMSIZE!\n");
assert(0);
}
printf("Read %lu bytes from gz stream in total\n", curr_size);
delete [] temp_page;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册