webengine/osswebengine/MemoryManager/Src/heap.cpp
branchRCL_3
changeset 40 8bfb9186a8b8
parent 10 a359256acfc6
child 46 30342f40acbf
equal deleted inserted replaced
38:4917f9bf7995 40:8bfb9186a8b8
  2342 		{	// grow, try and do this in place first
  2342 		{	// grow, try and do this in place first
  2343 		if (!map(offset(p, oldsz), sz-oldsz))
  2343 		if (!map(offset(p, oldsz), sz-oldsz))
  2344 			{
  2344 			{
  2345 			// need to allocate-copy-free
  2345 			// need to allocate-copy-free
  2346 			void* newp = map(0, sz);
  2346 			void* newp = map(0, sz);
  2347 			memcpy(newp, p, oldsz);
  2347             if(newp)
  2348 			unmap(p,oldsz);
  2348                 {
  2349 			return newp;
  2349                 memcpy(newp, p, oldsz);
       
  2350                 unmap(p,oldsz);
       
  2351                 return newp;
       
  2352                 }
       
  2353             else
       
  2354                 {
       
  2355                 return 0;
       
  2356                 }
  2350 			}
  2357 			}
  2351 		}
  2358 		}
  2352 	return p;
  2359 	return p;
  2353 }
  2360 }
  2354 
  2361