Added a couple of 'operator new()' definitions.
Started adding Array and BinaryHeap
This commit is contained in:
		| @ -80,6 +80,13 @@ void operator delete (void* ptr, QSE::Mmgr* mmgr) | ||||
| 	mmgr->dispose (ptr); | ||||
| } | ||||
|  | ||||
| void* operator new (qse_size_t size, QSE::Mmgr* mmgr, void* existing_ptr) | ||||
| { | ||||
| 	// mmgr unused. i put it in the parameter list to make this function | ||||
| 	// less conflicting with the stock ::operator new() that doesn't allocate. | ||||
| 	return existing_ptr; | ||||
| } | ||||
|  | ||||
| #if 0 | ||||
| void* operator new[] (qse_size_t size, QSE::Mmgr* mmgr) | ||||
| { | ||||
|  | ||||
| @ -182,7 +182,7 @@ QSE_END_NAMESPACE(QSE) | ||||
|  | ||||
| void* operator new (qse_size_t size, QSE::Mpool* mp) | ||||
| { | ||||
| 	return mp->isEnabled()? mp->allocate (): ::operator new (size, mp->getMmgr()); | ||||
| 	return mp->isEnabled()? mp->allocate(): ::operator new(size, mp->getMmgr()); | ||||
| } | ||||
|  | ||||
| void operator delete (void* ptr, QSE::Mpool* mp) | ||||
| @ -190,3 +190,8 @@ void operator delete (void* ptr, QSE::Mpool* mp) | ||||
| 	if (mp->isEnabled()) mp->dispose (ptr); | ||||
| 	else ::operator delete (ptr, mp->getMmgr()); | ||||
| } | ||||
|  | ||||
| void* operator new (qse_size_t size, QSE::Mpool* mp, void* existing_ptr) | ||||
| { | ||||
| 	return existing_ptr; | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user