Changeset 627 for GPL/branches/uniaud32-next/lib32/memory.c
- Timestamp:
- Jan 4, 2021, 9:57:55 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-next/lib32/memory.c
r624 r627 106 106 //****************************************************************************** 107 107 //****************************************************************************** 108 ULONG GetBaseAddress (ULONG addr, ULONG *pSize)108 ULONG GetBaseAddressAndFree(ULONG addr, ULONG *pSize) 109 109 { 110 110 BaseAddr NEAR *pCur, NEAR *pTemp; … … 131 131 132 132 _kfree(pTemp); 133 break; 134 } 135 pCur = pCur->next; 136 } 137 DevSti(); 138 return addr; 139 } 140 //****************************************************************************** 141 //****************************************************************************** 142 ULONG GetBaseAddressNoFree(ULONG addr, ULONG *pSize) 143 { 144 BaseAddr NEAR *pCur, NEAR *pTemp; 145 146 if(pBaseAddrHead == NULL) return addr; 147 148 DevCli(); 149 pCur = pBaseAddrHead; 150 151 if(pCur->retaddr == addr) 152 { 153 addr = pCur->base; 154 if(pSize) *pSize = pCur->size; 155 pBaseAddrHead = pCur->next; 156 // _kfree(pCur); 157 } 158 else 159 while(pCur->next) { 160 if(pCur->next->retaddr == addr) { 161 pTemp = pCur->next; 162 addr = pTemp->base; 163 if(pSize) *pSize = pTemp->size; 164 pCur->next = pTemp->next; 165 // _kfree(pTemp); 133 166 break; 134 167 } … … 374 407 375 408 //check if it really is the base of the allocation (see above) 376 addr = GetBaseAddress (addr, (ULONG NEAR *)__Stack32ToFlat(&size));409 addr = GetBaseAddressAndFree(addr, (ULONG NEAR *)__Stack32ToFlat(&size)); 377 410 378 411 if(VMFree((LINEAR)addr)) { … … 418 451 ULONG size = 0; 419 452 420 GetBaseAddress ((ULONG)ptr, (ULONG NEAR *)__Stack32ToFlat(&size));453 GetBaseAddressAndFree((ULONG)ptr, (ULONG NEAR *)__Stack32ToFlat(&size)); 421 454 422 455 if(VMFree((LINEAR)ptr)) { … … 662 695 return 0; 663 696 664 GetBaseAddress ((ULONG)block, (ULONG NEAR *)__Stack32ToFlat(&size));697 GetBaseAddressNoFree((ULONG)block, (ULONG NEAR *)__Stack32ToFlat(&size)); 665 698 666 699 return size;
Note:
See TracChangeset
for help on using the changeset viewer.