Optimize allocation function in XfdashboardDynamicTableLayout