Mercurial > mm7
comparison Allocator.cpp @ 720:05f7a11f4f20
Слияние
author | Ritor1 |
---|---|
date | Tue, 19 Mar 2013 23:41:29 +0600 |
parents | e39702f35283 |
children | c59ac5ea63f5 |
comparison
equal
deleted
inserted
replaced
719:d394cc892106 | 720:05f7a11f4f20 |
---|---|
19 | 19 |
20 | 20 |
21 //----- (00426755) -------------------------------------------------------- | 21 //----- (00426755) -------------------------------------------------------- |
22 void *Allocator::AllocNamedChunk(const void *pPrevPtrValue, unsigned int uSize, const char *pName) | 22 void *Allocator::AllocNamedChunk(const void *pPrevPtrValue, unsigned int uSize, const char *pName) |
23 { | 23 { |
24 | |
25 return malloc(uSize); | |
26 /* | |
24 //Allocator *v4; // esi@1 | 27 //Allocator *v4; // esi@1 |
25 unsigned int v5; // eax@7 | 28 unsigned int v5; // eax@7 |
26 void *result; // eax@8 | 29 void *result; // eax@8 |
27 // unsigned int *pNumBuffersUsed; // ebx@12 | 30 // unsigned int *pNumBuffersUsed; // ebx@12 |
28 unsigned int v8; // edi@15 | 31 unsigned int v8; // edi@15 |
81 if (pName) | 84 if (pName) |
82 strncpy(pMemoryBuffersNames[uNumBuffersUsed], pName, 11); | 85 strncpy(pMemoryBuffersNames[uNumBuffersUsed], pName, 11); |
83 uNextFreeOffsetInBigBuffer += aligned_size; | 86 uNextFreeOffsetInBigBuffer += aligned_size; |
84 } | 87 } |
85 return pMemoryBuffers[uNumBuffersUsed]; | 88 return pMemoryBuffers[uNumBuffersUsed]; |
86 | 89 */ |
87 /* | 90 /* |
88 //v4 = this; | 91 //v4 = this; |
89 if ( pPrevPtrValue && !aborting_app ) | 92 if ( pPrevPtrValue && !aborting_app ) |
90 AbortWithError(); | 93 AbortWithError(); |
91 if ( !bBigBufferAllocated && !aborting_app ) | 94 if ( !bBigBufferAllocated && !aborting_app ) |
179 | 182 |
180 | 183 |
181 //----- (00426474) -------------------------------------------------------- | 184 //----- (00426474) -------------------------------------------------------- |
182 void Allocator::FreeChunk(void *ptr) | 185 void Allocator::FreeChunk(void *ptr) |
183 { | 186 { |
184 Allocator *v2; // esi@1 | 187 free(ptr); |
188 return; | |
189 /* Allocator *v2; // esi@1 | |
185 unsigned int v3; // eax@5 | 190 unsigned int v3; // eax@5 |
186 signed int i; // edi@5 | 191 signed int i; // edi@5 |
187 unsigned int v5; // eax@13 | 192 unsigned int v5; // eax@13 |
188 signed int v6; // ecx@16 | 193 signed int v6; // ecx@16 |
189 signed int j; // edx@16 | 194 signed int j; // edx@16 |
199 if ((!bBigBufferAllocated)&& (!aborting_app )) | 204 if ((!bBigBufferAllocated)&& (!aborting_app )) |
200 AbortWithError(); | 205 AbortWithError(); |
201 for (indx = 0; indx <=uNumBuffersUsed; ++indx) | 206 for (indx = 0; indx <=uNumBuffersUsed; ++indx) |
202 if (pMemoryBuffers[indx] == ptr) | 207 if (pMemoryBuffers[indx] == ptr) |
203 break; | 208 break; |
204 if ((indx>uNumBuffersUsed)&& !aborting_app ) | 209 //if ((indx>uNumBuffersUsed)&& !aborting_app ) |
205 AbortWithError(); //to detect memory problems - uncomment | 210 //AbortWithError(); //to detect memory problems - uncomment |
206 if (!bUseBigBuffer) | 211 if (!bUseBigBuffer) |
207 free(pMemoryBuffers[indx]); | 212 free(pMemoryBuffers[indx]); |
208 pMemoryBuffers[indx] = NULL; | 213 pMemoryBuffers[indx] = NULL; |
209 uMemoryBuffersSizes[indx] = 0; | 214 uMemoryBuffersSizes[indx] = 0; |
210 pMemoryBuffersNames[indx][0] = 0; | 215 pMemoryBuffersNames[indx][0] = 0; |
228 uNumBuffersUsed = 0; | 233 uNumBuffersUsed = 0; |
229 uNextFreeOffsetInBigBuffer = 0; | 234 uNextFreeOffsetInBigBuffer = 0; |
230 } | 235 } |
231 } | 236 } |
232 } | 237 } |
233 | 238 */ |
234 /* | 239 /* |
235 v2 = this; | 240 v2 = this; |
236 if ( ptr ) | 241 if ( ptr ) |
237 { | 242 { |
238 if ( !this->bBigBufferAllocated && !aborting_app ) | 243 if ( !this->bBigBufferAllocated && !aborting_app ) |