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
This commit is contained in:
M. Liebmann
2016-09-06 11:30:06 +02:00
parent ff9a71cd36
commit 6a9c08ae90
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);