Assuming that you want to allocate in user space, use partition ID = 2.
The name can be a char string of anything you want - just use something descriptive for each block. I'm not sure if they have to be unique.
malloc() vs AllocPartitionMem() shouldn't be a cause of problems on 2.01+ : the most likely problem at this stage of development is just bugs in the eLoader itself, it's very unstable still.
Got a v2.0-v2.80 firmware PSP? Download the eLoader here to run homebrew on it!
The PSP Homebrew Database needs you!
The only difference you are likely to find is there is probably a finite limit to the number of allocations you can make with sceKernelAllocPartitionMemory because each allocation creates a new UID with its associated information. Whether this limit is small enough to make a different I do not know.
With malloc it just allocates a large memory block to use as its heap and then handles the allocations internally so you are just limited by the malloc implementation. If all you are going to do is allocate a large block then chunk that up in a malloc like fashion I do not see the real benefit to using it over malloc.
You'll probably also find that your libc has grabbed just about all of the AllocPartitionMemory heap at startup, to support malloc, so there won't be much left for AllocPartitionMemory.
There's a macro to set the size of the heap grabbed by newlib, though I forget the exact name - it shouldn't be hard to find.
Got a v2.0-v2.80 firmware PSP? Download the eLoader here to run homebrew on it!
The PSP Homebrew Database needs you!
/* Define the main thread's heap size (optional) */
/**
* ELF:
* Elf default is (Max) available memory block
*
* PRX:
* when making a prx, prx default heap size is (64K)
* if youd like to use more change below *
*/
PSP_HEAP_SIZE_KB(size_KB)
To be honest, you are probably better writing your own allocator. At the start of your progam, allocate a big chunk of memory. Then whenever you wanna do any more allocations, just allocate out of that chunk.
Use the sceKernelCreateFpl function (not sure if thats the exact spelling & capitalization)
Fpl = Fixed Pool
Theres also sceKernelAllocFpl which allocates inside of it. I'm fairly certain that CreateFpl internally calls AllocPartitionMemory, but Id still stay away from it.