CFileHelpers: Rework FileBuf handling

FileBuf: Reserve memory only when it is needed (copyFile)
copyFile: Reserve for small files, only as much memory as is required


Origin commit data
------------------
Commit: 6a9c08ae90
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-09-06 (Tue, 06 Sep 2016)
This commit is contained in:
Michael Liebmann
2016-09-06 11:30:06 +02:00
parent 640b0fca59
commit daf201ae37
2 changed files with 28 additions and 6 deletions

View File

@@ -84,10 +84,11 @@ struct helpersDebugInfo {
class CFileHelpers
{
private:
unsigned long FileBufSize;
char *FileBuf;
uint32_t FileBufMaxSize;
int fd1, fd2;
char* initFileBuf(char* buf, uint32_t size);
char* deleteFileBuf(char* buf);
bool ConsoleQuiet;
helpersDebugInfo DebugInfo;
void setDebugInfo(const char* msg, const char* file, const char* func, int line);