3 * Copyright Xamarin Inc (http://www.xamarin.com)
5 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
7 #ifndef __MONO_SGEN_LAYOUT_STATS_H__
8 #define __MONO_SGEN_LAYOUT_STATS_H__
10 #ifdef SGEN_OBJECT_LAYOUT_STATISTICS
12 #define SGEN_OBJECT_LAYOUT_BITMAP_BITS 16
14 void sgen_object_layout_scanned_bitmap (unsigned int bitmap
);
15 void sgen_object_layout_scanned_bitmap_overflow (void);
16 void sgen_object_layout_scanned_ref_array (void);
17 void sgen_object_layout_scanned_vtype_array (void);
19 void sgen_object_layout_dump (FILE *out
);
21 #define SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP unsigned int __object_layout_bitmap = 0
22 #define SGEN_OBJECT_LAYOUT_STATISTICS_MARK_BITMAP(o,p) do { \
23 int __index = ((void**)(p)) - ((void**)(((char*)(o)) + SGEN_CLIENT_OBJECT_HEADER_SIZE)); \
24 if (__index >= SGEN_OBJECT_LAYOUT_BITMAP_BITS) \
25 __object_layout_bitmap = (unsigned int)-1; \
26 else if (__object_layout_bitmap != (unsigned int)-1) \
27 __object_layout_bitmap |= (1 << __index); \
29 #define SGEN_OBJECT_LAYOUT_STATISTICS_COMMIT_BITMAP do { \
30 if (__object_layout_bitmap == (unsigned int)-1) \
31 sgen_object_layout_scanned_bitmap_overflow (); \
33 sgen_object_layout_scanned_bitmap (__object_layout_bitmap); \
38 #define sgen_object_layout_scanned_bitmap(bitmap)
39 #define sgen_object_layout_scanned_bitmap_overflow()
40 #define sgen_object_layout_scanned_ref_array()
41 #define sgen_object_layout_scanned_vtype_array()
43 #define sgen_object_layout_dump(out)
45 #define SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP
46 #define SGEN_OBJECT_LAYOUT_STATISTICS_MARK_BITMAP(o,p)
47 #define SGEN_OBJECT_LAYOUT_STATISTICS_COMMIT_BITMAP