| View previous topic :: View next topic |
| Author |
Message |
D_Street
Joined: 12 Jun 2008 Posts: 22 Location: Berkeley, CA
|
Posted: Fri Aug 29, 2008 9:54 pm Post subject: sceKernelAllocateFpl ? |
|
|
| 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! |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Fri Aug 29, 2008 11:23 pm Post subject: |
|
|
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: |
void *buf;
SceUID fpl = sceKernelCreateFpl("MyFPL", PSP_MEMORY_PARTITION_USER, 0, 4096, 1, NULL);
if (fpl < 0)
//handle error;
sceKernelAllocateFpl(fpl, &buf, NULL);
|
|
|
| Back to top |
|
 |
sauron_le_noir
Joined: 05 Jul 2008 Posts: 229
|
Posted: Sat Aug 30, 2008 3:42 am Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
|