const hwlmLiteral &lit = lits.front();
auto noodle = noodBuildTable(lit);
if (noodle) {
- engSize = noodSize(noodle.get());
+ engSize = noodle.size();
}
eng = move(noodle);
} else {
/*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
#include "hwlm_literal.h"
#include "noodle_internal.h"
-#include "util/alloc.h"
#include "util/compare.h"
#include "util/verify_types.h"
#include "ue2common.h"
return offset;
}
-aligned_unique_ptr<noodTable> noodBuildTable(const hwlmLiteral &lit) {
+bytecode_ptr<noodTable> noodBuildTable(const hwlmLiteral &lit) {
if (!lit.msk.empty()) {
DEBUG_PRINTF("noodle can't handle supplementary masks\n");
return nullptr;
const auto &s = lit.s;
size_t noodle_len = sizeof(noodTable) + s.length();
- auto n = aligned_zmalloc_unique<noodTable>(noodle_len);
+ auto n = make_bytecode_ptr<noodTable>(noodle_len);
assert(n);
size_t key_offset = findNoodFragOffset(lit);
/*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* \brief Noodle literal matcher: build code.
*/
-#ifndef NOODLE_BUILD_H_048A1A6D585A9A
-#define NOODLE_BUILD_H_048A1A6D585A9A
+#ifndef NOODLE_BUILD_H
+#define NOODLE_BUILD_H
#include "ue2common.h"
-#include "util/alloc.h"
+#include "util/bytecode_ptr.h"
struct noodTable;
struct hwlmLiteral;
/** \brief Construct a Noodle matcher for the given literal. */
-ue2::aligned_unique_ptr<noodTable> noodBuildTable(const hwlmLiteral &lit);
+bytecode_ptr<noodTable> noodBuildTable(const hwlmLiteral &lit);
size_t noodSize(const noodTable *n);
#endif // DUMP_SUPPORT
-#endif /* NOODLE_BUILD_H_048A1A6D585A9A */
+#endif /* NOODLE_BUILD_H */