Lines Matching full:size
54 unsigned long size;
93 static uint32 findBin(size_t size)
98 if ((int)size <= bin)
135 static void MemoryTrackingAdd(size_t size)
138 uint32 bin = findBin(size);
192 gMemoryTracking.sCurrentAllocationSize += size;
193 gMemoryTracking.sTotalAllocationSize += size;
207 gMemoryTracking.sCurrentAllocationSizeArray[bin] += size;
208 gMemoryTracking.sTotalAllocationSizeArray[bin] += size;
219 static void MemoryTrackingDelete(unsigned long size)
222 uint32 bin = findBin(size);
225 gMemoryTracking.sCurrentAllocationSize -= size;
228 gMemoryTracking.sCurrentAllocationSizeArray[bin] -= size;
246 memoryPool[i].poolInfo[j].size = 0;
271 memoryPool[i].poolInfo[j].size = 0;
299 /* Invalid partition size */
331 memoryPool[whichPool].poolInfo[currentNumberOfPools].size = poolSize;
347 static void* AllocateFromPsos(uint32 whichPool, uint32 poolIndex, uint32 size)
360 *((unsigned long *)pMemory) = (whichPool << 27) + (poolIndex << 24) + size;
367 static void* SearchPoolsForMemory(uint32 whichPool, uint32 size)
374 pMemory = malloc(size);
384 *((unsigned long *)pMemory) = (whichPool << 27) + size;
391 pMemory = AllocateFromPsos(whichPool, poolIndex, size);
397 if (AddPool(whichPool, memoryPool[whichPool].poolInfo[0].size >> 1) == FALSE)
399 /* All pools of this size have been consumed */
404 pMemory = AllocateFromPsos(whichPool, memoryPool[whichPool].currentNumberOfPools - 1, size);
415 void* PortMemBlockAllocateFromPool(uint32 size)
422 PORT_ASSERT((size & 0xff000000) == 0);
424 size += 4;
425 whichPool = findBin(size); /* Add 4 so I can store info with data */
426 MemoryTrackingAdd(size);
428 /* If pool exists for the size needed, then use it, else find next largest pool */
442 pMemory = SearchPoolsForMemory(whichPool, size);
469 /* PortMemGetPoolSize() : return size of portable memory pool, or 0 if
474 return 0; /* TODO: Find size of pool: 4Mar02 */
477 /* PortMemBlockSetPoolSize() : set size of portable memory pool on PSOS.
521 printf("Max size of 2^%2d byte objects = %d\n", i, gMemoryTracking.sMaximumAllocationSizeArray[i]);