{"id":21,"date":"2014-07-03T07:55:22","date_gmt":"2014-07-03T07:55:22","guid":{"rendered":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=21"},"modified":"2014-07-04T16:30:23","modified_gmt":"2014-07-04T16:30:23","slug":"the-ovm_int_t-type","status":"publish","type":"post","link":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=21","title":{"rendered":"The ovm_int_t type"},"content":{"rendered":"<p>The <code>ovm_int_t<\/code> type is the OrchIDS incarnation of the data type of signed machine integers.<\/p>\n<p><!--more--><\/p>\n<p>It is defined this way in <tt>src\/lang.h<\/tt>:<\/p>\n<pre>typedef struct ovm_int_s ovm_int_t;\r\nstruct ovm_int_s\r\n{\r\n  gc_header_t gc;\r\n  long val;\r\n};<\/pre>\n<p>This is a type of <a title=\"Garbage collection\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=18\">garbage-collectable<\/a> data.\u00a0 To allocate a new object of type <code>ovm_int_t<\/code>, use the function:<\/p>\n<pre>ovm_var_t *ovm_int_new(gc_t *gc_ctx, long val);<\/pre>\n<p>This creates a new <code>ovm_int_t<\/code> object with value <code>val<\/code>. Its return type is the universal type <a title=\"The ovm_var_t universal type\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?page_id=121\"><code>ovm_var_t<\/code><\/a> instead of <code>ovm_int_t<\/code>, for practical reasons. Calling <code>res<\/code> the result, one always has <code>TYPE(res)==T_INT<\/code>.<\/p>\n<p>The result is created white, and much be <code>gc_touch()<\/code>ed before storing it into a garbage-collectable object.<\/p>\n<p>The returned <code>ovm_int_t<\/code> object <code>res<\/code> is modifiable. One can read from or write from it by using the <code>INT()<\/code> macro (e.g., <code>int i=INT(res); INT(res) = 3;<\/code>).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The ovm_int_t type is the OrchIDS incarnation of the data type of signed machine integers.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-21","post","type-post","status-publish","format-standard","hentry","category-data-types","category-virtual-machine"],"_links":{"self":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=21"}],"version-history":[{"count":9,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts\/21\/revisions"}],"predecessor-version":[{"id":136,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts\/21\/revisions\/136"}],"wp:attachment":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}