mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 10:10:34 +08:00
Dynamic memory refactoring: Entire library now uses IPoolAllocator instead of IAllocator, which was removed completely. This change was needed to enable TX queue constraints, see the next commits.
This commit is contained in:
@@ -15,7 +15,7 @@ class UAVCAN_EXPORT INode
|
||||
{
|
||||
public:
|
||||
virtual ~INode() { }
|
||||
virtual IAllocator& getAllocator() = 0;
|
||||
virtual IPoolAllocator& getAllocator() = 0;
|
||||
virtual Scheduler& getScheduler() = 0;
|
||||
virtual const Scheduler& getScheduler() const = 0;
|
||||
virtual IMarshalBufferProvider& getMarshalBufferProvider() = 0;
|
||||
|
||||
@@ -122,7 +122,7 @@ class UAVCAN_EXPORT GenericSubscriber : public GenericSubscriberBase
|
||||
}
|
||||
|
||||
public:
|
||||
TransferForwarder(SelfType& obj, const DataTypeDescriptor& data_type, IAllocator& allocator)
|
||||
TransferForwarder(SelfType& obj, const DataTypeDescriptor& data_type, IPoolAllocator& allocator)
|
||||
: TransferListenerType(obj.node_.getDispatcher().getTransferPerfCounter(), data_type, allocator)
|
||||
, obj_(obj)
|
||||
{ }
|
||||
@@ -198,7 +198,7 @@ int GenericSubscriber<DataSpec, DataStruct, TransferListenerType>::checkInit()
|
||||
UAVCAN_TRACE("GenericSubscriber", "Type [%s] is not registered", DataSpec::getDataTypeFullName());
|
||||
return -ErrUnknownDataType;
|
||||
}
|
||||
forwarder_.template construct<SelfType&, const DataTypeDescriptor&, IAllocator&>
|
||||
forwarder_.template construct<SelfType&, const DataTypeDescriptor&, IPoolAllocator&>
|
||||
(*this, *descr, node_.getAllocator());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ class UAVCAN_EXPORT Scheduler : Noncopyable
|
||||
void pollCleanup(MonotonicTime mono_ts, uint32_t num_frames_processed_with_last_spin);
|
||||
|
||||
public:
|
||||
Scheduler(ICanDriver& can_driver, IAllocator& allocator, ISystemClock& sysclock, IOutgoingTransferRegistry& otr)
|
||||
Scheduler(ICanDriver& can_driver, IPoolAllocator& allocator, ISystemClock& sysclock, IOutgoingTransferRegistry& otr)
|
||||
: dispatcher_(can_driver, allocator, sysclock, otr)
|
||||
, prev_cleanup_ts_(sysclock.getMonotonic())
|
||||
, deadline_resolution_(MonotonicDuration::fromMSec(DefaultDeadlineResolutionMs))
|
||||
|
||||
Reference in New Issue
Block a user