I have the error "POSIX reports: The operation couldn’t be completed. Cannot allocate memory" when trying to partition an internal MBP 13" Mid-2010 on Snow Leopard OS. And I receive a different error if I try to partition the drive using the Lion install disc. It was something like "error: wiping volume data to prevent future accidental probing failed".
If you have these errors I'm fairly certain it's the Hard Drive cable that needs replaced. It worked for me, but you might want to try simply disconnecting the cable from the motherboard and reconnecting it (gently pull the cable and do not use any metal tools near the motherboard).
For more detail, I installed a second hard drive in my MBP when I first got it and I can dual boot Snow Leopard from my original hard drive and Lion from and solid state drive I installed. The Lion disk is where my original hard drive was and I moved the original hard drive into a little caddy that fits where the optical drive was (and I put the optical drive into an external USB enclosure so I can still use it). I had an issue on my Lion disk after 3 years where every open app was throwing crazy errors. I recycled the power and it hung on the gray apple screen with a spinning bar underneath and would never boot into Lion again. I messed around with a whole bunch of stuff I found online, but ultimately it was the hard drive ribbon. Oh, also I wanted to mention my battery is getting very old and can't hold a charge which I thought may have played a factor so I swapped my battery too while I was in there swapping the hard drive cable. Good luck to anyone that finds this!