Changeset 223 in dev for trunk/abdev/BasicCompiler_Common/PESchedule.cpp
- Timestamp:
- Jul 19, 2007, 3:38:13 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/PESchedule.cpp
r206 r223 25 25 length=0; 26 26 NowPageRVAToReloc=0; 27 28 pdwData_CodeSection=(DWORD *)HeapAlloc(hHeap,0,1);29 iNum_CodeSection=0;30 pdwData_DataSection=(DWORD *)HeapAlloc(hHeap,0,1);31 iNum_DataSection=0;32 27 } 33 28 CReloc::~CReloc(){ … … 39 34 buffer=0; 40 35 } 41 42 HeapDefaultFree(pdwData_CodeSection);43 HeapDefaultFree(pdwData_DataSection);44 36 } 45 37 void CReloc::copy(CReloc *por){ … … 57 49 NowCountAddrToReloc=por->NowCountAddrToReloc; 58 50 59 iNum_CodeSection=por->iNum_CodeSection; 60 pdwData_CodeSection=(DWORD *)HeapAlloc(hHeap,0,iNum_CodeSection*sizeof(DWORD)); 61 memcpy(pdwData_CodeSection,por->pdwData_CodeSection,iNum_CodeSection*sizeof(DWORD)); 62 63 iNum_DataSection=por->iNum_DataSection; 64 pdwData_DataSection=(DWORD *)HeapAlloc(hHeap,0,iNum_DataSection*sizeof(DWORD)); 65 memcpy(pdwData_DataSection,por->pdwData_DataSection,iNum_DataSection*sizeof(DWORD)); 51 codeSectionAddresses = por->codeSectionAddresses; 52 53 dataSectionAddresses = por->dataSectionAddresses; 66 54 } 67 55 … … 70 58 if(!bDll) return; 71 59 72 pdwData_CodeSection=(DWORD *)HeapReAlloc(hHeap,0,pdwData_CodeSection,(iNum_CodeSection+1)*sizeof(DWORD)); 73 pdwData_CodeSection[iNum_CodeSection]=addr; 74 iNum_CodeSection++; 60 codeSectionAddresses.push_back( addr ); 75 61 } 76 62 void CReloc::AddSchedule_DataSection(DWORD addr){ … … 78 64 if(!bDll) return; 79 65 80 pdwData_DataSection=(DWORD *)HeapReAlloc(hHeap,0,pdwData_DataSection,(iNum_DataSection+1)*sizeof(DWORD)); 81 pdwData_DataSection[iNum_DataSection]=addr; 82 iNum_DataSection++; 66 dataSectionAddresses.push_back( addr ); 83 67 } 84 68 … … 136 120 NowPageRVAToReloc=0; 137 121 138 int i;139 for(i=0;i<iNum_CodeSection;i++){122 BOOST_FOREACH( DWORD addr, codeSectionAddresses ) 123 { 140 124 extern int MemPos_CodeSection; 141 __add(MemPos_CodeSection + pdwData_CodeSection[i]); 142 } 143 144 for(i=0;i<iNum_DataSection;i++){ 125 __add(MemPos_CodeSection + addr); 126 } 127 128 BOOST_FOREACH( DWORD addr, dataSectionAddresses ) 129 { 145 130 extern int MemPos_DataSection; 146 __add(MemPos_DataSection + pdwData_DataSection[i]);131 __add(MemPos_DataSection + addr); 147 132 } 148 133 }
Note:
See TracChangeset
for help on using the changeset viewer.