Prevent trying to build smallwrite engine for large cases

This commit is contained in:
Alex Coyte
2016-05-30 14:00:31 +10:00
committed by Matthew Barr
parent b097cb1b53
commit cb7067f59d
7 changed files with 34 additions and 15 deletions

View File

@@ -75,14 +75,15 @@ using namespace std;
namespace ue2 {
NG::NG(const CompileContext &in_cc, unsigned in_somPrecision)
NG::NG(const CompileContext &in_cc, size_t num_patterns,
unsigned in_somPrecision)
: maxSomRevHistoryAvailable(in_cc.grey.somMaxRevNfaLength),
minWidth(depth::infinity()),
rm(in_cc.grey),
ssm(in_somPrecision),
cc(in_cc),
rose(makeRoseBuilder(rm, ssm, cc, boundary)),
smwr(makeSmallWriteBuilder(rm, cc)) {
smwr(makeSmallWriteBuilder(num_patterns, rm, cc)) {
}
NG::~NG() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Intel Corporation
* Copyright (c) 2015-2016, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -87,7 +87,8 @@ class SmallWriteBuild;
class NG : boost::noncopyable {
public:
NG(const CompileContext &in_cc, unsigned in_somPrecision);
NG(const CompileContext &in_cc, size_t num_patterns,
unsigned in_somPrecision);
~NG();
/** \brief Consumes a pattern, returns false or throws a CompileError