Permalink
Browse files

Add mono_ptr_array_reset and mono_ptr_array_clear

  • Loading branch information...
kumpera committed May 19, 2011
1 parent 5c82e32 commit eeaef244ba1ac7815cc1006a364c254e0d4dd44a
Showing with 9 additions and 0 deletions.
  1. +9 −0 mono/metadata/mono-ptr-array.h
@@ -62,4 +62,13 @@ typedef struct {
#define mono_ptr_array_size(ARRAY) ((ARRAY).size)
+#define mono_ptr_array_reset(ARRAY) do { \
+ (ARRAY).size = 0; \
+} while (0)
+
+#define mono_ptr_array_clear(ARRAY) do { \
+ (ARRAY).size = 0; \
+ mono_gc_bzero ((ARRAY).data, (ARRAY).capacity * sizeof (void*)); \
+} while (0)
+
#endif

0 comments on commit eeaef24

Please sign in to comment.