mirror of
https://github.com/ksherlock/mpw.git
synced 2024-11-21 09:30:55 +00:00
newhandle/sethandlesize fixes for ppclink
This commit is contained in:
parent
48558e9885
commit
ace2810e34
@ -284,9 +284,12 @@ namespace MM
|
||||
|
||||
// todo -- size 0 should have a ptr to differentiate
|
||||
// from purged.
|
||||
if (size)
|
||||
{
|
||||
ptr = (uint8_t *)mplite_malloc(&pool, size);
|
||||
|
||||
// PPCLink calls NewHandle(0) but expects a valid pointer
|
||||
// Assertion failed: *fHandle != NULL
|
||||
//if (size)
|
||||
//{
|
||||
ptr = (uint8_t *)mplite_malloc(&pool, size ? size : 1);
|
||||
if (!ptr)
|
||||
{
|
||||
HandleQueue.push_back(hh);
|
||||
@ -296,7 +299,7 @@ namespace MM
|
||||
|
||||
if (clear)
|
||||
std::memset(ptr, 0, size);
|
||||
}
|
||||
//}
|
||||
|
||||
// need a handle -> ptr map?
|
||||
HandleMap.emplace(std::make_pair(hh, HandleInfo(mcptr, size)));
|
||||
@ -411,7 +414,14 @@ namespace MM
|
||||
// 1. - resizing to 0.
|
||||
if (!newSize)
|
||||
{
|
||||
if (info.locked) return SetMemError(MacOS::memLockedErr);
|
||||
if (info.locked)
|
||||
{
|
||||
//return SetMemError(MacOS::memLockedErr);
|
||||
|
||||
// ppclink resizes locked handles.
|
||||
info.size = 0;
|
||||
return SetMemError(0);
|
||||
}
|
||||
|
||||
// todo -- size 0 should have a ptr to differentiate
|
||||
// from purged.
|
||||
|
Loading…
Reference in New Issue
Block a user