Note that item_do() now aborts on OOM, since it's pretty pointless to iterate further if memory allocation doesn't work.