mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[ntcore] Match standard handle layout, only allow 16 instances (#3577)
Now that there are only 16 instances, store them all statically. Make tests more reliable by using different ports for each connection in listener tests.
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
|
||||
#include <wpi/UidVector.h>
|
||||
#include <wpi/mutex.h>
|
||||
|
||||
#include "ConnectionNotifier.h"
|
||||
@@ -47,8 +46,8 @@ class InstanceImpl {
|
||||
static int AllocImpl();
|
||||
|
||||
static std::atomic<int> s_default;
|
||||
static std::atomic<InstanceImpl*> s_fast_instances[10];
|
||||
static wpi::UidVector<InstanceImpl*, 10> s_instances;
|
||||
static constexpr int kNumInstances = 16;
|
||||
static std::atomic<InstanceImpl*> s_instances[kNumInstances];
|
||||
static wpi::mutex s_mutex;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user