Skip to content

Commit 8540c36

Browse files
authored
FPGA: Remove unused memory allocation in the gzip sample (#2386)
The gzip code sample included a memory allocation of the size of the file to be compressed, which was issued for every repeated iteration of the kernel. This led to increasingly large host memory allocation when the file to compress was increasing in size. However, the allocated memory was never used. This change therefore removes the unneeded allocation.
1 parent 23bb205 commit 8540c36

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

  • DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/gzip/src

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/gzip/src/gzip.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ struct KernelInfo {
196196
buffer<unsigned, 1> *current_crc;
197197
buffer<char, 1> *pobuf;
198198
buffer<char, 1> *pibuf;
199-
char *pobuf_decompress;
200199

201200
uint32_t buffer_crc[kMinBufferSize];
202201
uint32_t refcrc;
@@ -319,7 +318,6 @@ int CompressFile(queue &q, std::string &input_file, std::vector<std::string> out
319318
: new buffer<char, 1>(input_alloc_size);
320319
kinfo[eng][i].pobuf =
321320
i >= 3 ? kinfo[eng][i - 3].pobuf : new buffer<char, 1>(outputSize);
322-
kinfo[eng][i].pobuf_decompress = (char *)malloc(kinfo[eng][i].file_size);
323321
}
324322
}
325323

@@ -527,7 +525,6 @@ int CompressFile(queue &q, std::string &input_file, std::vector<std::string> out
527525
free(kinfo[eng][i].poutput_buffer);
528526
}
529527
}
530-
free(kinfo[eng][i].pobuf_decompress);
531528
}
532529
free(kinfo[eng]);
533530
}

0 commit comments

Comments
 (0)