Could you add a comment why there are so many hoops that are jumped through to allocate some memory?