mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-16 20:17:05 +03:00
Little maintenance update
* Little documentation fixes
* Added virtual destructor to emit helpers to silence warnings of
some compilers (it's totally useless change though as it changes
nothing in reality - emit helpers are allocated mostly on stack)
This commit is contained in:
@@ -24,6 +24,8 @@ public:
|
||||
ASMJIT_INLINE_NODEBUG explicit EmitHelper(BaseEmitter* emitter = nullptr) noexcept
|
||||
: BaseEmitHelper(emitter) {}
|
||||
|
||||
ASMJIT_INLINE_NODEBUG virtual ~EmitHelper() noexcept = default;
|
||||
|
||||
Error emitRegMove(
|
||||
const Operand_& dst_,
|
||||
const Operand_& src_, TypeId typeId, const char* comment = nullptr) override;
|
||||
|
||||
@@ -742,8 +742,9 @@ namespace asmjit {
|
||||
//! JitAllocator::Span span;
|
||||
//! Error err = allocator.alloc(span, estimatedSize);
|
||||
//!
|
||||
//! if (err != kErrorOk) // <- NOTE: This must be checked, always!
|
||||
//! if (err != kErrorOk) { // <- NOTE: This must be checked, always!
|
||||
//! return 0;
|
||||
//! }
|
||||
//!
|
||||
//! // Now relocate the code to the address provided by the memory allocator.
|
||||
//! // Please note that this DOESN'T COPY anything to it. This function will
|
||||
@@ -780,15 +781,16 @@ namespace asmjit {
|
||||
//! int out[4];
|
||||
//!
|
||||
//! // This code uses AsmJit's ptr_as_func<> to cast between void* and SumIntsFunc.
|
||||
//! ptr_as_func<SumIntsFunc>(p)(out, inA, inB);
|
||||
//! SumIntsFunc fn = ptr_as_func<SumIntsFunc>(span.rx());
|
||||
//! fn(out, inA, inB);
|
||||
//!
|
||||
//! // Prints {5 8 4 9}
|
||||
//! printf("{%d %d %d %d}\n", out[0], out[1], out[2], out[3]);
|
||||
//!
|
||||
//! // Release 'p' is it's no longer needed. It will be destroyed with 'vm'
|
||||
//! // Release `fn` is it's no longer needed. It will be destroyed with 'vm'
|
||||
//! // instance anyway, but it's a good practice to release it explicitly
|
||||
//! // when you know that the function will not be needed anymore.
|
||||
//! allocator.release(p);
|
||||
//! allocator.release(fn);
|
||||
//!
|
||||
//! return 0;
|
||||
//! }
|
||||
|
||||
@@ -24,6 +24,8 @@ public:
|
||||
ASMJIT_INLINE_NODEBUG explicit BaseEmitHelper(BaseEmitter* emitter = nullptr) noexcept
|
||||
: _emitter(emitter) {}
|
||||
|
||||
ASMJIT_INLINE_NODEBUG virtual ~BaseEmitHelper() noexcept = default;
|
||||
|
||||
ASMJIT_INLINE_NODEBUG BaseEmitter* emitter() const noexcept { return _emitter; }
|
||||
ASMJIT_INLINE_NODEBUG void setEmitter(BaseEmitter* emitter) noexcept { _emitter = emitter; }
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ public:
|
||||
_avxEnabled(avxEnabled || avx512Enabled),
|
||||
_avx512Enabled(avx512Enabled) {}
|
||||
|
||||
ASMJIT_INLINE_NODEBUG virtual ~EmitHelper() noexcept = default;
|
||||
|
||||
Error emitRegMove(
|
||||
const Operand_& dst_,
|
||||
const Operand_& src_, TypeId typeId, const char* comment = nullptr) override;
|
||||
|
||||
Reference in New Issue
Block a user