Add worker function to set allocation size