Remove two allocs in the prio queues in sched_time_pf.

master
faluco 4 years ago committed by faluco
parent 7df308c756
commit 69726bc939

@ -72,8 +72,12 @@ private:
struct ue_ul_prio_compare {
bool operator()(const ue_ctxt* lhs, const ue_ctxt* rhs) const;
};
std::priority_queue<ue_ctxt*, std::vector<ue_ctxt*>, ue_dl_prio_compare> dl_queue;
std::priority_queue<ue_ctxt*, std::vector<ue_ctxt*>, ue_ul_prio_compare> ul_queue;
using ue_dl_queue_t = std::priority_queue<ue_ctxt*, std::vector<ue_ctxt*>, ue_dl_prio_compare>;
using ue_ul_queue_t = std::priority_queue<ue_ctxt*, std::vector<ue_ctxt*>, ue_ul_prio_compare>;
ue_dl_queue_t dl_queue;
ue_ul_queue_t ul_queue;
uint32_t try_dl_alloc(ue_ctxt& ue_ctxt, sched_ue& ue, sf_sched* tti_sched);
uint32_t try_ul_alloc(ue_ctxt& ue_ctxt, sched_ue& ue, sf_sched* tti_sched);

@ -11,6 +11,7 @@
*/
#include "srsenb/hdr/stack/mac/schedulers/sched_time_pf.h"
#include <vector>
namespace srsenb {
@ -22,6 +23,14 @@ sched_time_pf::sched_time_pf(const sched_cell_params_t& cell_params_, const sche
if (not sched_args.sched_policy_args.empty()) {
fairness_coeff = std::stof(sched_args.sched_policy_args);
}
std::vector<ue_ctxt *> dl_storage;
dl_storage.reserve(SRSENB_MAX_UES);
dl_queue = ue_dl_queue_t(ue_dl_prio_compare{}, std::move(dl_storage));
std::vector<ue_ctxt *> ul_storage;
ul_storage.reserve(SRSENB_MAX_UES);
ul_queue = ue_ul_queue_t(ue_ul_prio_compare{}, std::move(ul_storage));
}
void sched_time_pf::new_tti(sched_ue_list& ue_db, sf_sched* tti_sched)

Loading…
Cancel
Save