+// memory allocation
+
+void* rfxalloc(int size)
+{
+ void*ptr;
+#ifdef HAVE_CALLOC
+ ptr = calloc(size);
+#else
+ ptr = malloc(size);
+ memset(ptr, 0, size);
+#endif
+ if(!ptr) {
+ fprintf(stderr, "FATAL: Out of memory\n");
+ /* TODO: we should send a signal, so that the debugger kicks in */
+ exit(1);
+ }
+ return ptr;
+}
+
+void rfxdealloc(void*ptr)
+{
+ free(ptr);
+}
+