summaryrefslogtreecommitdiff
path: root/python/examples/refcounting/runtime/refcounting.h
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthew@masot.net>2023-07-27 14:26:33 -0700
committerMatthew Sotoudeh <matthew@masot.net>2023-07-27 14:26:33 -0700
commit2b8985608d33abaae7b201a008e292cbbe2167ef (patch)
tree58a76aaf7c7447988b1c78095480dc8bce5d2ab4 /python/examples/refcounting/runtime/refcounting.h
parent578531395ecbabd8179e31520c2832ac7d6d3765 (diff)
add automated refcounting pass
Diffstat (limited to 'python/examples/refcounting/runtime/refcounting.h')
-rw-r--r--python/examples/refcounting/runtime/refcounting.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/examples/refcounting/runtime/refcounting.h b/python/examples/refcounting/runtime/refcounting.h
new file mode 100644
index 0000000..139f09a
--- /dev/null
+++ b/python/examples/refcounting/runtime/refcounting.h
@@ -0,0 +1,8 @@
+#pragma once
+
+// wrapper for calloc
+void *refcount_calloc(unsigned long count, unsigned long size);
+// overwrite a pointer that pointed to 'old' to now point to 'new'
+void refcount_write(void *new, void *old);
+// decrement the refcount, but do not free if the refcount hits 0
+void refcount_returning(void *ptr);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback