#include "parser/utf8_validate.h"
#include "rose/rose_build.h"
#include "som/slot_manager_dump.h"
-#include "util/alloc.h"
+#include "util/bytecode_ptr.h"
#include "util/compile_error.h"
#include "util/target_info.h"
#include "util/verify_types.h"
}
static
-aligned_unique_ptr<RoseEngine> generateRoseEngine(NG &ng) {
+bytecode_ptr<RoseEngine> generateRoseEngine(NG &ng) {
const u32 minWidth =
ng.minWidth.is_finite() ? verify_u32(ng.minWidth) : ROSE_BOUND_INF;
auto rose = ng.rose->buildRose(minWidth);
#include "ue2common.h"
#include "rose_common.h"
#include "rose_in_graph.h"
-#include "util/alloc.h"
+#include "util/bytecode_ptr.h"
#include "util/charreach.h"
#include "util/noncopyable.h"
#include "util/ue2_containers.h"
bool eod) = 0;
/** \brief Construct a runtime implementation. */
- virtual ue2::aligned_unique_ptr<RoseEngine> buildRose(u32 minWidth) = 0;
+ virtual bytecode_ptr<RoseEngine> buildRose(u32 minWidth) = 0;
virtual std::unique_ptr<RoseDedupeAux> generateDedupeAux() const = 0;
}
static
-aligned_unique_ptr<RoseEngine> addSmallWriteEngine(const RoseBuildImpl &build,
- aligned_unique_ptr<RoseEngine> rose) {
+bytecode_ptr<RoseEngine> addSmallWriteEngine(const RoseBuildImpl &build,
+ bytecode_ptr<RoseEngine> rose) {
assert(rose);
if (roseIsPureLiteral(rose.get())) {
const size_t smwrOffset = ROUNDUP_CL(mainSize);
const size_t newSize = smwrOffset + smallWriteSize;
- auto rose2 = aligned_zmalloc_unique<RoseEngine>(newSize);
+ auto rose2 = make_bytecode_ptr<RoseEngine>(newSize, 64);
char *ptr = (char *)rose2.get();
memcpy(ptr, rose.get(), mainSize);
memcpy(ptr + smwrOffset, smwr_engine.get(), smallWriteSize);
return lqm;
}
-aligned_unique_ptr<RoseEngine> RoseBuildImpl::buildFinalEngine(u32 minWidth) {
+bytecode_ptr<RoseEngine> RoseBuildImpl::buildFinalEngine(u32 minWidth) {
// We keep all our offsets, counts etc. in a prototype RoseEngine which we
// will copy into the real one once it is allocated: we can't do this
// until we know how big it will be.
proto.size = currOffset;
- // Time to allocate the real RoseEngine structure.
- auto engine = aligned_zmalloc_unique<RoseEngine>(currOffset);
+ // Time to allocate the real RoseEngine structure, at cacheline alignment.
+ auto engine = make_bytecode_ptr<RoseEngine>(currOffset, 64);
assert(engine); // will have thrown bad_alloc otherwise.
// Copy in our prototype engine data.
}
#endif // NDEBUG
-aligned_unique_ptr<RoseEngine> RoseBuildImpl::buildRose(u32 minWidth) {
+bytecode_ptr<RoseEngine> RoseBuildImpl::buildRose(u32 minWidth) {
dumpRoseGraph(*this, "rose_early.dot");
// Early check for Rose implementability.
#include "nfa/nfa_internal.h"
#include "nfagraph/ng_holder.h"
#include "nfagraph/ng_revacc.h"
-#include "util/alloc.h"
+#include "util/bytecode_ptr.h"
#include "util/order_check.h"
#include "util/queue_index_factory.h"
#include "util/ue2_containers.h"
bool eod) override;
// Construct a runtime implementation.
- aligned_unique_ptr<RoseEngine> buildRose(u32 minWidth) override;
- aligned_unique_ptr<RoseEngine> buildFinalEngine(u32 minWidth);
+ bytecode_ptr<RoseEngine> buildRose(u32 minWidth) override;
+ bytecode_ptr<RoseEngine> buildFinalEngine(u32 minWidth);
void setSom() override { hasSom = true; }