+ // Well, darn
+ nextHead = malloc( __size );
+ nextHead -= 1;
+
+ memcpy(
+ nextHead->Data,
+ __ptr,
+ head->Size - sizeof(tHeapFoot) - sizeof(tHeapHead)
+ );
+
+ free(__ptr);
+
+ return nextHead->Data;
+}
+
+/**
+ * \fn void *calloc(size_t num, size_t size)
+ * \brief Allocate and Zero a buffer in memory
+ * \param num Number of elements
+ * \param size Size of each element
+ */
+void *calloc(size_t num, size_t size)
+{
+ void *ret = malloc(num*size);
+ if(ret == NULL) return NULL;
+
+ memset( ret, 0, num*size );
+
+ return ret;
+}
+
+/**
+ * \fn int IsHeap(void *Ptr)
+ * \brief Checks if an address is a heap pointer
+ */
+int IsHeap(void *Ptr)
+{
+ tHeapHead *head;
+ if((Uint)Ptr < (Uint)gHeapStart) return 0;
+ if((Uint)Ptr > (Uint)gHeapEnd) return 0;
+ if((Uint)Ptr & (sizeof(Uint)-1)) return 0;
+
+ head = (void*)( (Uint)Ptr - sizeof(tHeapHead) );
+ if(head->Magic != MAGIC_USED && head->Magic != MAGIC_FREE)
+ return 0;
+
+ return 1;