{"id":33,"date":"2014-07-03T08:12:29","date_gmt":"2014-07-03T08:12:29","guid":{"rendered":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=33"},"modified":"2014-07-04T16:29:40","modified_gmt":"2014-07-04T16:29:40","slug":"the-ovm_uint_t-type","status":"publish","type":"post","link":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/?p=33","title":{"rendered":"The ovm_uint_t type"},"content":{"rendered":"<p>The <code>ovm_uint_t<\/code> type is the OrchIDS incarnation of the data type of unsigned 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_uint_s ovm_uint_t;\r\nstruct ovm_uint_s\r\n{\r\n  gc_header_t gc;\r\n  unsigned 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. To allocate a new object of type <code>ovm_uint_t<\/code>, use the function:<\/p>\n<pre>ovm_var_t *ovm_uint_new(gc_t *gc_ctx, unsigned long val);<\/pre>\n<p>This creates a new <code>ovm_uint_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_uint_t<\/code>, for practical reasons. Calling <code>res<\/code> the result, one always has <code>TYPE(res)==T_UINT<\/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_uint_t<\/code> object <code>res<\/code> is modifiable. One can read from or write from it by using the <code>UINT()<\/code> macro (e.g., <code>unsigned int i=UINT(res); UINT(res) = 3;<\/code>).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The ovm_uint_t type is the OrchIDS incarnation of the data type of unsigned 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-33","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\/33","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=33"}],"version-history":[{"count":5,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":135,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions\/135"}],"wp:attachment":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}