1
0
Fork 0

Added MEM_AllocatedPages. Get amount of allocated pages of handle

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1148
This commit is contained in:
Ulf Wohlers 2003-07-24 19:13:58 +00:00
parent 54ef7a5825
commit 2daf8b32c7
2 changed files with 10 additions and 1 deletions

View file

@ -468,7 +468,6 @@ Bitu MEM_FreeLargest(void) {
return largest;
}
Bitu MEM_FreeTotal(void) {
Bitu free=0;
Bitu index=XMS_START;
@ -479,6 +478,15 @@ Bitu MEM_FreeTotal(void) {
return free;
}
Bitu MEM_AllocatedPages(MemHandle handle)
{
Bitu pages = 0;
while (handle>0) {
pages++;
handle=memory.entries[handle].next_handle;
}
return pages;
}
//TODO Maybe some protection for this whole allocation scheme