Changeset 631
- Timestamp:
- Jan 5, 2021, 5:15:50 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-next/lib32/memory.c
r627 r631 73 73 74 74 typedef struct _BaseAddr { 75 ULONG base; 76 ULONG retaddr; 77 ULONG size; 75 ULONG base; // VMAlloc addr 76 ULONG retaddr; // aligned addr returned to caller 77 ULONG size; // VMAlloc size 78 78 struct _BaseAddr NEAR *next; 79 79 } BaseAddr; … … 115 115 pCur = pBaseAddrHead; 116 116 117 // If address is in list, remove list item and free entry 118 // Caller must VMFree returned address or else 117 119 if(pCur->retaddr == addr) 118 120 { … … 287 289 288 290 if(startpage != endpage) { 289 // try once more291 // not in same 32K page, try once more 290 292 rc = VMAlloc(size, flags, (LINEAR *)&tempaddr); 291 293 VMFree((LINEAR)addr); … … 377 379 378 380 if (startpage != endpage) { 381 // Not in same 32K page 379 382 physaddr2 = (startpage+1) << 16; 380 383 … … 690 693 691 694 if (!block) 692 return 0; 693 694 if (block == ZERO_SIZE_PTR) 695 return 0; 696 697 GetBaseAddressNoFree((ULONG)block, (ULONG NEAR *)__Stack32ToFlat(&size)); 695 size = 0; // Bad coder 696 697 else if (block == ZERO_SIZE_PTR) 698 size = 0; // Bad coder 699 700 else if(IsHeapAddr((ULONG)block)) 701 size = _msize((void _near *)block); 702 703 else if (!GetBaseAddressNoFree((ULONG)block, (ULONG NEAR *)__Stack32ToFlat(&size))) 704 size = 0; // Something wrong 698 705 699 706 return size;
Note:
See TracChangeset
for help on using the changeset viewer.