Home | History | Annotate | Download | only in src

Lines Matching full:whichpool

282   static BOOL CreatePool(uint32 whichPool, uint32 poolSize)
289 uint32 currentNumberOfPools = memoryPool[whichPool].currentNumberOfPools;
291 PORT_ASSERT((whichPool >= 0) && (whichPool < NUM_POOL_BINS));
297 if (whichPool < 2)
307 pMemory = malloc(poolSize * (1 << whichPool) + PARTITION_CONTROL_BLOCK_SIZE);
320 retval = pt_create(name, pMemory, 0, poolSize * (1 << whichPool) + PARTITION_CONTROL_BLOCK_SIZE,
321 1 << whichPool, PT_LOCAL | PT_DEL, &poolId, &unused);
329 memoryPool[whichPool].poolInfo[currentNumberOfPools].poolId = poolId;
330 memoryPool[whichPool].poolInfo[currentNumberOfPools].pMemory = pMemory;
331 memoryPool[whichPool].poolInfo[currentNumberOfPools].size = poolSize;
332 memoryPool[whichPool].currentNumberOfPools++;
339 static BOOL AddPool(uint32 whichPool, uint32 poolSize)
341 if (memoryPool[whichPool].poolInfo[0].pMemory == NULL)
344 return CreatePool(whichPool, poolSize);
347 static void* AllocateFromPsos(uint32 whichPool, uint32 poolIndex, uint32 size)
352 PORT_ASSERT(memoryPool[whichPool].poolInfo[poolIndex].poolId);
354 retval = pt_getbuf(memoryPool[whichPool].poolInfo[poolIndex].poolId, &pMemory);
360 *((unsigned long *)pMemory) = (whichPool << 27) + (poolIndex << 24) + size;
367 static void* SearchPoolsForMemory(uint32 whichPool, uint32 size)
372 if (whichPool == 0)
384 *((unsigned long *)pMemory) = (whichPool << 27) + size;
389 for (poolIndex = 0; poolIndex < memoryPool[whichPool].currentNumberOfPools; poolIndex++)
391 pMemory = AllocateFromPsos(whichPool, poolIndex, size);
397 if (AddPool(whichPool, memoryPool[whichPool].poolInfo[0].size >> 1) == FALSE)
404 pMemory = AllocateFromPsos(whichPool, memoryPool[whichPool].currentNumberOfPools - 1, size);
420 uint32 whichPool;
425 whichPool = findBin(size); /* Add 4 so I can store info with data */
429 for (poolIndex = whichPool; poolIndex < 32; poolIndex++)
433 whichPool = poolIndex;
439 whichPool = 0;
442 pMemory = SearchPoolsForMemory(whichPool, size);
451 uint32 whichPool = (*pRealMemory >> 27) & 0x0000001f;
458 if (whichPool == 0)
464 uint32 retval = pt_retbuf(memoryPool[whichPool].poolInfo[whichBin].poolId, pRealMemory);