Esempio n. 1
0
        public static SceKernelFplInfo tryCreateFpl(string name, int partitionid, int attr, int blockSize, int numBlocks, int memType, int memAlign)
        {
            SceKernelFplInfo info = null;
            int alignedBlockSize  = memAlign == 0 ? blockSize : Utilities.alignUp(blockSize, memAlign - 1);
            int totalFplSize      = alignedBlockSize * numBlocks;
            int maxFreeSize       = Modules.SysMemUserForUserModule.maxFreeMemSize(partitionid);

            if (totalFplSize <= maxFreeSize)
            {
                info = new SceKernelFplInfo(name, partitionid, attr, blockSize, numBlocks, memType, memAlign);
            }
            else
            {
                Modules.Console.WriteLine("tryCreateFpl not enough free mem (want=" + totalFplSize + ", free=" + maxFreeSize + ", diff=" + (totalFplSize - maxFreeSize) + ")");
            }

            return(info);
        }