code: func expandMemorySizeConfig(d *schema.ResourceData) int64 {
  	om, nm := d.GetChange("memory")
  	cha, _ := d.GetChange("memory_hot_add_enabled")
  	currentHotAdd := cha.(bool)
  	oldMem := int64(om.(int))
  	newMem := int64(nm.(int))
  
  	switch {
  	case oldMem < newMem:
  		// Adding CPUs
  		if !currentHotAdd {
  			log.Printf("[DEBUG] %s: Memory operation requires a VM restart", resourceVSphereVirtualMachineIDString(d))
  			d.Set("reboot_required", true)
  		}
  	case oldMem > newMem:
  		// Removing memory always requires a reboot
  		log.Printf("[DEBUG] %s: Memory operation requires a VM restart", resourceVSphereVirtualMachineIDString(d))
  		d.Set("reboot_required", true)
  	}
  	return newMem
  }
docs: // expandMemorySizeConfig is a helper for expandVirtualMachineConfigSpec that
  // determines if we need to restart the system to increase the amount of
  // available memory on the system. This is determined by the current (or in
  // other words, the old, pre-update setting) of memory_hot_add_enabled.