rose_build_anchored: use bytecode_ptr

This commit is contained in:
Justin Viiret
2017-04-03 16:47:21 +10:00
committed by Matthew Barr
parent 7b17d418e7
commit 905ac78061
3 changed files with 10 additions and 13 deletions

View File

@@ -869,14 +869,13 @@ vector<raw_dfa> buildAnchoredDfas(RoseBuildImpl &build,
return dfas;
}
aligned_unique_ptr<anchored_matcher_info>
bytecode_ptr<anchored_matcher_info>
buildAnchoredMatcher(RoseBuildImpl &build, const vector<LitFragment> &fragments,
vector<raw_dfa> &dfas, size_t *asize) {
vector<raw_dfa> &dfas) {
const CompileContext &cc = build.cc;
if (dfas.empty()) {
DEBUG_PRINTF("empty\n");
*asize = 0;
return nullptr;
}
@@ -892,8 +891,7 @@ buildAnchoredMatcher(RoseBuildImpl &build, const vector<LitFragment> &fragments,
throw ResourceLimitError();
}
*asize = total_size;
auto atable = aligned_zmalloc_unique<anchored_matcher_info>(total_size);
auto atable = make_bytecode_ptr<anchored_matcher_info>(total_size, 64);
char *curr = (char *)atable.get();
u32 state_offset = 0;
@@ -919,7 +917,7 @@ buildAnchoredMatcher(RoseBuildImpl &build, const vector<LitFragment> &fragments,
ami->anchoredMinDistance = start_offset[i];
}
DEBUG_PRINTF("success %zu\n", *asize);
DEBUG_PRINTF("success %zu\n", atable.size());
return atable;
}