1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-02 03:20:06 +00:00

New class HeapBlock, which provides a safe and object-oriented way to allocate heap space. I've used HeapBlocks to replace almost all uses of malloc/free throughout the codebase.

This commit is contained in:
Julian Storer 2010-01-02 14:55:44 +00:00
parent 8c988319ec
commit 4ed1d791e5
86 changed files with 22712 additions and 22630 deletions

View file

@ -318,10 +318,9 @@ void var::writeToStream (OutputStream& output) const throw()
const int len = value.stringValue->copyToUTF8 (0);
output.writeCompressedInt (len + 1);
output.writeByte (5);
uint8* const temp = (uint8*) juce_malloc (len);
HeapBlock <uint8> temp (len);
value.stringValue->copyToUTF8 (temp);
output.write (temp, len);
juce_free (temp);
break;
}
case objectType: output.writeCompressedInt (0); jassertfalse; break; // Can't write an object to a stream!