mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
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: 0a1cdb3d4e
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-09-06 (Tue, 06 Sep 2016)
This commit is contained in:
committed by
vanhofen
parent
5adbe389b8
commit
9a8a094be9
@@ -675,8 +675,21 @@ CFileHelpers::CFileHelpers()
|
||||
|
||||
CFileHelpers::~CFileHelpers()
|
||||
{
|
||||
if (FileBuf != NULL)
|
||||
delete [] FileBuf;
|
||||
}
|
||||
|
||||
char* CFileHelpers::initFileBuf(char* buf, uint32_t size)
|
||||
{
|
||||
if (buf == NULL)
|
||||
buf = new char[size];
|
||||
return buf;
|
||||
}
|
||||
|
||||
char* CFileHelpers::deleteFileBuf(char* buf)
|
||||
{
|
||||
if (buf != NULL)
|
||||
delete [] buf;
|
||||
buf = NULL;
|
||||
return buf;
|
||||
}
|
||||
|
||||
CFileHelpers* CFileHelpers::getInstance()
|
||||
|
Reference in New Issue
Block a user