# include "config.h"
#endif
-#include <stdlib.h>
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
#include "array.h"
#include "xmalloc.h"
* Resize a flexible array, allocate more data if needed but do NOT
* reduce.
*
- * @param elts The flexible array (pointer to the first element).
- * @param nelts The new number of elements.
- * @param elts_size The size of the array elements.
+ * @param elts The flexible array (pointer to the first element).
+ * @param nelts The new number of elements.
+ * @param eltsize The size of the array elements.
*
* @return A resized flexible array, possibly other address than
* elts.
return dp->v.elts;
}
+
+#ifdef DEBUG_libfirm
+/**
+ * This function returns the length of a flexible array.
+ * Do NOT use is in code, use ARR_LEN() macro!
+ * This function is intended to be called from a debugger.
+ */
+int array_len(void *arr) {
+ return ARR_LEN(arr);
+}
+
+/**
+ * This function returns the array descriptor of a flexible array.
+ * Do NOT use is in code!.
+ * This function is intended to be called from a debugger.
+ */
+_arr_descr *array_descr(void *arr) {
+ if (! arr)
+ return NULL;
+ return _ARR_DESCR(arr);
+}
+#endif /* DEBUG_libfirm */