Reduced PciTopology class size.

This commit is contained in:
XMRig 2019-09-27 01:03:37 +07:00
parent 56e070b3d1
commit 18bf9d3d95

View file

@ -40,12 +40,12 @@ class PciTopology
{
public:
PciTopology() = default;
PciTopology(uint32_t bus, uint32_t device, uint32_t function) : m_bus(bus), m_device(device), m_function(function) {}
PciTopology(uint32_t bus, uint32_t device, uint32_t function) : m_valid(true), m_bus(bus), m_device(device), m_function(function) {}
inline bool isValid() const { return m_bus >= 0; }
inline uint32_t bus() const { return isValid() ? m_bus : 0; }
inline uint32_t device() const { return m_device; }
inline uint32_t function() const { return m_function; }
inline bool isValid() const { return m_valid; }
inline uint8_t bus() const { return m_bus; }
inline uint8_t device() const { return m_device; }
inline uint8_t function() const { return m_function; }
String toString() const
{
@ -60,9 +60,10 @@ public:
}
private:
int32_t m_bus = -1;
uint32_t m_device = 0;
uint32_t m_function = 0;
bool m_valid = false;
uint8_t m_bus = 0;
uint8_t m_device = 0;
uint8_t m_function = 0;
};