diff --git a/src/fdr/fdr_confirm_compile.cpp b/src/fdr/fdr_confirm_compile.cpp index 367ba693..5e1a540e 100644 --- a/src/fdr/fdr_confirm_compile.cpp +++ b/src/fdr/fdr_confirm_compile.cpp @@ -45,8 +45,7 @@ using namespace std; namespace ue2 { -using BC2CONF = map, size_t>>; +using BC2CONF = map>; // return the number of bytes beyond a length threshold in all strings in lits static @@ -148,9 +147,9 @@ void fillLitInfo(const vector &lits, vector &tmpLitInfo, //#define FDR_CONFIRM_DUMP 1 -static pair, size_t> -getFDRConfirm(const vector &lits, bool make_small, - bool make_confirm) { +static +bytecode_ptr getFDRConfirm(const vector &lits, + bool make_small, bool make_confirm) { vector tmpLitInfo(lits.size()); CONF_TYPE andmsk; fillLitInfo(lits, tmpLitInfo, andmsk); @@ -285,7 +284,7 @@ getFDRConfirm(const vector &lits, bool make_small, sizeof(LitInfo) * lits.size() + totalLitSize; size = ROUNDUP_N(size, alignof(FDRConfirm)); - auto fdrc = aligned_zmalloc_unique(size); + auto fdrc = make_bytecode_ptr(size); assert(fdrc); // otherwise would have thrown std::bad_alloc fdrc->andmsk = andmsk; @@ -339,7 +338,7 @@ getFDRConfirm(const vector &lits, bool make_small, alignof(FDRConfirm)); assert(actual_size <= size); - return {move(fdrc), actual_size}; + return fdrc; } bytecode_ptr @@ -365,7 +364,7 @@ setupFullConfs(const vector &lits, DEBUG_PRINTF("b %d sz %zu\n", b, vl.size()); auto fc = getFDRConfirm(vl, make_small, makeConfirm); - totalConfirmSize += fc.second; + totalConfirmSize += fc.size(); bc2Conf.emplace(b, move(fc)); } } @@ -382,11 +381,11 @@ setupFullConfs(const vector &lits, for (const auto &m : bc2Conf) { const BucketIndex &idx = m.first; - const pair, size_t> &p = m.second; + const bytecode_ptr &p = m.second; // confirm offset is relative to the base of this structure, now u32 confirm_offset = verify_u32(ptr - buf.get()); - memcpy(ptr, p.first.get(), p.second); - ptr += p.second; + memcpy(ptr, p.get(), p.size()); + ptr += p.size(); confBase[idx] = confirm_offset; }