+
+#include <string.h>
+
+typedef struct atom_body
+{
+ evaltype type; // UNBOUND/LOCI
+ // bindid
+ // value ptr
+ // oblist ptr
+ // type ptr
+ char pname[];
+} atom_body;
+
+atom_object
+atom_create (const char *name, uint32_t namelen)
+{
+ // C-compatible strings for simplicity
+ namelen += 1;
+ heap_ptr body = atom_body_alloc (namelen);
+ atom_body *content = (atom_body *) HEAP_OBJECT (body);
+ memcpy (&content->pname, name, namelen - 1);
+ content->pname[namelen - 1] = '\0';
+ atom_object new = new_atom (body, namelen);
+ return new;
+}
+
+heap_ptr
+atom_body_alloc (uint32_t namelen)
+{
+ return heap_alloc_uv ((sizeof (atom_body) + namelen + 63) / 64);
+}
+
+const char *
+atom_pname (atom_object o)
+{
+ return ATOM_BODY (o.val.body)->pname;
+}