TINSEL: Remove MemoryHandle(), some unneeded #includes and the return value of MemoryReAlloc()

svn-id: r45408
This commit is contained in:
Max Horn 2009-10-26 16:01:12 +00:00
parent b0b1ab70c3
commit b9534216ed
5 changed files with 3 additions and 30 deletions

View File

@ -34,7 +34,6 @@
#include "tinsel/font.h"
#include "tinsel/graphics.h"
#include "tinsel/handle.h"
#include "tinsel/heapmem.h"
#include "tinsel/multiobj.h"
#include "tinsel/sched.h"
#include "tinsel/strres.h"

View File

@ -170,9 +170,7 @@ void SetupHandleTable(void) {
#endif
else {
// allocate a discarded memory node for other files
pH->_node = MemoryAlloc(
DWM_DISCARDABLE | DWM_NOALLOC,
pH->filesize & FSIZE_MASK);
pH->_node = MemoryAlloc(DWM_DISCARDABLE | DWM_NOALLOC, pH->filesize & FSIZE_MASK);
pH->_ptr = NULL;
// make sure memory allocated

View File

@ -430,7 +430,7 @@ void *MemoryLock(MEM_NODE *pMemNode) {
* @param size New size of block
* @param flags How to reallocate the object
*/
MEM_NODE *MemoryReAlloc(MEM_NODE *pMemNode, long size, int flags) {
void MemoryReAlloc(MEM_NODE *pMemNode, long size, int flags) {
MEM_NODE *pNew;
// validate mnode pointer
@ -471,9 +471,6 @@ MEM_NODE *MemoryReAlloc(MEM_NODE *pMemNode, long size, int flags) {
// free the new node
FreeMemNode(pNew);
}
// return the node
return pMemNode;
}
/**
@ -494,21 +491,4 @@ void MemoryUnlock(MEM_NODE *pMemNode) {
pMemNode->lruTime = DwGetCurrentTime();
}
/**
* Retrieves the mnode associated with the specified pointer to a memory object.
* @param pMem Address of memory object
*/
MEM_NODE *MemoryHandle(void *pMem) {
MEM_NODE *pNode;
// search the DOS heap
for (pNode = heapSentinel.pNext; pNode != &heapSentinel; pNode = pNode->pNext) {
if (pNode->pBaseAddr == pMem)
// found it
return pNode;
}
// not found if we get to here
return NULL;
}
} // End of namespace Tinsel

View File

@ -69,13 +69,10 @@ void *MemoryAllocFixed(long size);
void MemoryDiscard( // discards the specified memory object
MEM_NODE *pMemNode); // node of the memory object
MEM_NODE *MemoryHandle( // Retrieves the mnode associated with the specified pointer to a memory object
void *pMem); // address of memory object
void *MemoryLock( // locks a memory object and returns a pointer to the first byte of the objects memory block
MEM_NODE *pMemNode); // node of the memory object
MEM_NODE *MemoryReAlloc( // changes the size or attributes of a specified memory object
void MemoryReAlloc( // changes the size or attributes of a specified memory object
MEM_NODE *pMemNode, // node of the memory object
long size, // new size of block
int flags); // how to reallocate the object

View File

@ -33,7 +33,6 @@
#include "tinsel/faders.h" // FadeOutFast()
#include "tinsel/graphics.h" // ClearScreen()
#include "tinsel/handle.h"
#include "tinsel/heapmem.h"
#include "tinsel/dialogs.h"
#include "tinsel/music.h"
#include "tinsel/pid.h"