libjit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: structures


From: Aleksey Demakov
Subject: Re: structures
Date: Tue, 26 Nov 2019 00:59:52 +0300

Hi Michael,

On Mon, Nov 25, 2019 at 4:24 PM Michael Rolnik <address@hidden> wrote:
> could you please explain or point me to a tutorial that explains how to use 
> structures.
> I understand structure are create by  jit_type_create_struct function, but I 
> could not find how to access struct members from within jit context and from 
> host program.
>

The function jit_type_create_struct() defines a struct type. The
function jit_type_get_size() returns the size of the type. You can
allocate the required memory somewhere. Then to compile a code that
accesses a field of the struct you need to have a jit_value_t with the
struct address and then use jit_insn_load_relative() and
jit_insn_store_relative() functions together with
jit_type_get_offset().

Regards,
Aleksey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]