sceKernelAllocateFpl ?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
D_Street
Posts: 22
Joined: Thu Jun 12, 2008 2:09 pm
Location: Berkeley, CA

sceKernelAllocateFpl ?

Post by D_Street »

I sort of know it is used after sceKernelCreateFpl(), can anyone tell me where does this function allocate memory from? from the kernel memory or the user memory? If someone can point me to more infos about this function would be awesome, thinks!
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

The second param indicates the partition, usually PSP_MEMORY_PARTITION_USER or PSP_MEMORY_PARTITION_KERNEL. It has no much secrets, the main difference of this function with others, is that this one enters in lock state until the memory can be allocated (or until an optional timeout has passed).

Allocate 4096 bytes:

Code: Select all

void *buf;
SceUID fpl = sceKernelCreateFpl("MyFPL", PSP_MEMORY_PARTITION_USER, 0, 4096, 1, NULL);

if &#40;fpl < 0&#41;
   //handle error;

sceKernelAllocateFpl&#40;fpl, &buf, NULL&#41;;
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

Post by sauron_le_noir »

what is the advantage of using sceKernelAllocateFpl instead of malloc or sbrk ? Partition 2 for user mem is always present with the maximun memory or am i wrong
Post Reply