2 * Copyright Xamarin Inc (http://www.xamarin.com)
4 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
6 #ifndef __MONO_SGEN_LAYOUT_STATS_H__
7 #define __MONO_SGEN_LAYOUT_STATS_H__
9 #ifdef SGEN_OBJECT_LAYOUT_STATISTICS
11 #define SGEN_OBJECT_LAYOUT_BITMAP_BITS 16
13 void sgen_object_layout_scanned_bitmap (unsigned int bitmap);
14 void sgen_object_layout_scanned_bitmap_overflow (void);
15 void sgen_object_layout_scanned_ref_array (void);
16 void sgen_object_layout_scanned_vtype_array (void);
18 void sgen_object_layout_dump (FILE *out);
20 #define SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP unsigned int __object_layout_bitmap = 0
21 #define SGEN_OBJECT_LAYOUT_STATISTICS_MARK_BITMAP(o,p) do { \
22 int __index = ((void**)(p)) - ((void**)(((char*)(o)) + SGEN_CLIENT_OBJECT_HEADER_SIZE)); \
23 if (__index >= SGEN_OBJECT_LAYOUT_BITMAP_BITS) \
24 __object_layout_bitmap = (unsigned int)-1; \
25 else if (__object_layout_bitmap != (unsigned int)-1) \
26 __object_layout_bitmap |= (1 << __index); \
28 #define SGEN_OBJECT_LAYOUT_STATISTICS_COMMIT_BITMAP do { \
29 if (__object_layout_bitmap == (unsigned int)-1) \
30 sgen_object_layout_scanned_bitmap_overflow (); \
32 sgen_object_layout_scanned_bitmap (__object_layout_bitmap); \
37 #define sgen_object_layout_scanned_bitmap(bitmap)
38 #define sgen_object_layout_scanned_bitmap_overflow()
39 #define sgen_object_layout_scanned_ref_array()
40 #define sgen_object_layout_scanned_vtype_array()
42 #define sgen_object_layout_dump(out)
44 #define SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP
45 #define SGEN_OBJECT_LAYOUT_STATISTICS_MARK_BITMAP(o,p)
46 #define SGEN_OBJECT_LAYOUT_STATISTICS_COMMIT_BITMAP