Changes between Version 107 and Version 108 of IR2


Ignore:
Timestamp:
05/20/21 09:29:59 (5 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR2

    v107 v108  
    322322Notes
    323323
    324 A heap is an abstraction for a set of objects of possibly different types which can be referenced by pointers.   A C statement that mallocs 10 ints, e.g.,
     324A heap is an abstraction for a set of objects of possibly different types which can be referenced by pointers.   `$alloc` adds an object to the heap and returns a pointer to that object.   The object can then be read or modified using the pointer.  Example: C code that mallocs 10 ints
    325325{{{
    326326int * p = malloc(10*sizeof(int));
     
    335335
    336336More generally, if the type of objects being malloced is not known, or changes dynamically, one could define a general "object" type...
     337{{{
     338struct $object {
     339  $int size; // in bytes
     340  $map<$int,$any> data; // byte offset -> element
     341}
     342typedef struct $object $object;
     343}}}
     344But this requires `$any` ... (think about this) ...
     345
    337346
    338347=== bundle.cvh ===