@@ -114,6 +114,22 @@ struct VM_t {
114114
115115typedef struct VM_t VM;
116116
117+
118+/* C data interface: allocation on the C heap.
119+ *
120+ * Although not enforced in code, CData is meant to be opaque
121+ * and non-RTS code (such as libraries or C bindings) should
122+ * access it only in the following three ways:
123+ *
124+ * CData cd = cdata_allocate(...);
125+ * use(cd->data);
126+ * cdata_free(cd); // optionally
127+ *
128+ */
129+typedef CHeapItem * CData;
130+CData cdata_allocate(size_t size, CDataFinalizer_t * finalizer);
131+void cdata_free(CData cd); // explicit freeing not required but available
132+
117133// Create a new VM
118134VM* init_vm(int stack_size, size_t heap_size,
119135 int max_threads);