1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

break loadFile_orDie() into 2: loadFile_orDie() loads file into a pre-allocated memory buffer, mallocAndLoadFile_orDie() allocates memory first, then calls loadFile_orDie()

This commit is contained in:
Yi Jin
2018-12-17 16:54:55 -08:00
parent 452689678b
commit bc4dc606de
6 changed files with 41 additions and 28 deletions

View File

@ -19,7 +19,7 @@
static void compress_orDie(const char* fname, const char* oname)
{
size_t fSize;
void* const fBuff = loadFile_orDie(fname, &fSize, 0, 0);
void* const fBuff = mallocAndLoadFile_orDie(fname, &fSize);
size_t const cBuffSize = ZSTD_compressBound(fSize);
void* const cBuff = malloc_orDie(cBuffSize);