NewPtr(0) should return a non-null pointer.

This commit is contained in:
Kelvin Sherlock 2015-01-16 15:38:20 -05:00
parent e8d756c1b6
commit 92d465fb56

View File

@ -241,10 +241,10 @@ namespace MM
// native pointers.
mcptr = 0;
if (size == 0) return 0;
//if (size == 0) return 0;
uint8_t *ptr = nullptr;
ptr = (uint8_t *)mplite_malloc(&pool, size);
ptr = (uint8_t *)mplite_malloc(&pool, size ? size : 1);
if (!ptr)
{
return SetMemError(MacOS::memFullErr);