Skip to content

Commit 0f64578

Browse files
committed
Removes byte-counting for v8
1 parent b14de2d commit 0f64578

File tree

3 files changed

+0
-54
lines changed

3 files changed

+0
-54
lines changed

src/tsp.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ NAN_METHOD(TSP::New) try {
3434

3535
TSPSolverParams userParams{info};
3636

37-
const auto bytesChange = getBytes(userParams.costs);
38-
Nan::AdjustExternalMemory(bytesChange);
39-
4037
auto* self = new TSP{std::move(userParams.costs)};
4138

4239
self->Wrap(info.This());

src/types.h

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -69,45 +69,4 @@ using RouteLocks = std::vector<LockChain>;
6969
using Pickups = NewType<Vector<NodeIndex>, struct PickupsTag>::Type;
7070
using Deliveries = NewType<Vector<NodeIndex>, struct DeliveriesTag>::Type;
7171

72-
// Bytes in our type used for internal caching
73-
74-
template <typename T> struct Bytes;
75-
76-
template <> struct Bytes<CostMatrix> {
77-
std::int32_t operator()(const CostMatrix& v) const { return v.size() * sizeof(CostMatrix::Value); }
78-
};
79-
80-
template <> struct Bytes<DurationMatrix> {
81-
std::int32_t operator()(const DurationMatrix& v) const { return v.size() * sizeof(DurationMatrix::Value); }
82-
};
83-
84-
template <> struct Bytes<DemandMatrix> {
85-
std::int32_t operator()(const DemandMatrix& v) const { return v.size() * sizeof(DemandMatrix::Value); }
86-
};
87-
88-
template <> struct Bytes<TimeWindows> {
89-
std::int32_t operator()(const TimeWindows& v) const { return v.size() * sizeof(TimeWindows::Value); }
90-
};
91-
92-
template <> struct Bytes<RouteLocks> {
93-
std::int32_t operator()(const RouteLocks& v) const {
94-
std::int32_t bytes = 0;
95-
96-
for (const auto& lockChain : v)
97-
bytes += lockChain.size() * sizeof(LockChain::value_type);
98-
99-
return bytes;
100-
}
101-
};
102-
103-
template <> struct Bytes<Pickups> {
104-
std::int32_t operator()(const Pickups& v) const { return v.size() * sizeof(Pickups::Value); }
105-
};
106-
107-
template <> struct Bytes<Deliveries> {
108-
std::int32_t operator()(const Deliveries& v) const { return v.size() * sizeof(Deliveries::Value); }
109-
};
110-
111-
template <typename T> std::int32_t getBytes(const T& v) { return Bytes<T>{}(v); }
112-
11372
#endif

src/vrp.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ NAN_METHOD(VRP::New) try {
3333

3434
VRPSolverParams userParams{info};
3535

36-
const auto bytesChange = getBytes(userParams.costs) //
37-
+ getBytes(userParams.durations) //
38-
+ getBytes(userParams.timeWindows) //
39-
+ getBytes(userParams.demands); //
40-
41-
Nan::AdjustExternalMemory(bytesChange);
42-
4336
auto* self = new VRP{std::move(userParams.costs), //
4437
std::move(userParams.durations), //
4538
std::move(userParams.timeWindows), //
@@ -58,9 +51,6 @@ NAN_METHOD(VRP::Solve) try {
5851

5952
VRPSearchParams userParams(info);
6053

61-
const auto bytesChange = getBytes(userParams.routeLocks);
62-
Nan::AdjustExternalMemory(bytesChange);
63-
6454
// See routing_parameters.proto and routing_enums.proto
6555
auto modelParams = RoutingModel::DefaultModelParameters();
6656
auto searchParams = RoutingModel::DefaultSearchParameters();

0 commit comments

Comments
 (0)