Adding Cartesian product function to memory pools.