create_memory_block_externT_create_memory_block_externCreateMemoryBlockExternCreateMemoryBlockExterncreate_memory_block_extern (Operator)
Name
create_memory_block_externT_create_memory_block_externCreateMemoryBlockExternCreateMemoryBlockExterncreate_memory_block_extern
— Create a memory block from an external pointer.
Warning
It is not recommended to use the operator create_memory_block_externcreate_memory_block_externCreateMemoryBlockExternCreateMemoryBlockExterncreate_memory_block_extern
in HDevelop.
Signature
Description
create_memory_block_externcreate_memory_block_externCreateMemoryBlockExternCreateMemoryBlockExterncreate_memory_block_extern
creates a memory block and returns its
handle MemoryBlockHandleMemoryBlockHandleMemoryBlockHandlememoryBlockHandlememory_block_handle
. PointerPointerPointerpointerpointer
is a data pointer to the
beginning of the memory block. SizeSizeSizesizesize
controls the size in bytes of the
memory block. FreeFunctionFreeFunctionFreeFunctionfreeFunctionfree_function
is an optional callback function that
frees the memory pointed to by PointerPointerPointerpointerpointer
. This function must have the
following signature
void FreeFunction(void* ptr);
and will be called using
__cdecl
calling convention when deleting
MemoryBlockHandleMemoryBlockHandleMemoryBlockHandlememoryBlockHandlememory_block_handle
. Hence, HALCON gains ownership over the memory in
this case and releases the memory via the callback function. If the memory
shall not be released when deleting
MemoryBlockHandleMemoryBlockHandleMemoryBlockHandlememoryBlockHandlememory_block_handle
, i.e., HALCON
shall not own the memory, the NULL-Pointer can be passed.
Attention
This operator does not copy any data. If a copy is required
create_memory_block_extern_copycreate_memory_block_extern_copyCreateMemoryBlockExternCopyCreateMemoryBlockExternCopycreate_memory_block_extern_copy
can be used.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.
Parameters
PointerPointerPointerpointerpointer
(input_control) pointer →
HTupleintHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)
Data pointer of the memory block.
SizeSizeSizesizesize
(input_control) integer →
HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Size of the memory block.
FreeFunctionFreeFunctionFreeFunctionfreeFunctionfree_function
(input_control) pointer →
HTupleintHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)
Function to free the memory block.
Default:
0
MemoryBlockHandleMemoryBlockHandleMemoryBlockHandlememoryBlockHandlememory_block_handle
(output_control) memory_block →
HMemoryBlock, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the memory block.
Result
If the parameters are valid, the operator create_memory_block_externcreate_memory_block_externCreateMemoryBlockExternCreateMemoryBlockExterncreate_memory_block_extern
returns the value 2 (
H_MSG_TRUE)
. If necessary, an exception is raised.
Possible Successors
get_memory_block_ptrget_memory_block_ptrGetMemoryBlockPtrGetMemoryBlockPtrget_memory_block_ptr
,
compare_memory_blockcompare_memory_blockCompareMemoryBlockCompareMemoryBlockcompare_memory_block
,
memory_block_to_imagememory_block_to_imageMemoryBlockToImageMemoryBlockToImagememory_block_to_image
,
write_memory_blockwrite_memory_blockWriteMemoryBlockWriteMemoryBlockwrite_memory_block
Alternatives
create_memory_block_extern_copycreate_memory_block_extern_copyCreateMemoryBlockExternCopyCreateMemoryBlockExternCopycreate_memory_block_extern_copy
Module
Foundation