diff --git a/sopang.cpp b/sopang.cpp index b5c0a1c..ee8e10e 100644 --- a/sopang.cpp +++ b/sopang.cpp @@ -9,6 +9,16 @@ using namespace std; +Sopang::Sopang() +{ + dBuffer = new uint64_t[dBufferSize]; +} + +Sopang::~Sopang() +{ + delete[] dBuffer; +} + const string *const *Sopang::parseTextArray(string text, unsigned *nSegments, unsigned **segmentSizes) { boost::trim(text); diff --git a/sopang.hpp b/sopang.hpp index fed4a89..0f34283 100644 --- a/sopang.hpp +++ b/sopang.hpp @@ -11,6 +11,9 @@ using namespace std; class Sopang { public: + Sopang(); + ~Sopang(); + static const string *const *parseTextArray(string text, unsigned *nSegments, unsigned **segmentSizes); static vector parsePatterns(string patternsStr); @@ -26,7 +29,7 @@ class Sopang static constexpr uint64_t allOnes = ~(0x0ULL); - uint64_t dBuffer[dBufferSize]; + uint64_t *dBuffer; uint64_t maskBuffer[maskBufferSize]; };