sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 1 | /* |
bart | 86562bd | 2009-02-16 19:43:56 +0000 | [diff] [blame] | 2 | This file is part of drd, a thread error detector. |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 3 | |
bart | d4bab99 | 2013-10-04 05:55:30 +0000 | [diff] [blame] | 4 | Copyright (C) 2006-2013 Bart Van Assche <bvanassche@acm.org>. |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 5 | |
| 6 | This program is free software; you can redistribute it and/or |
| 7 | modify it under the terms of the GNU General Public License as |
| 8 | published by the Free Software Foundation; either version 2 of the |
| 9 | License, or (at your option) any later version. |
| 10 | |
| 11 | This program is distributed in the hope that it will be useful, but |
| 12 | WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | General Public License for more details. |
| 15 | |
| 16 | You should have received a copy of the GNU General Public License |
| 17 | along with this program; if not, write to the Free Software |
| 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
| 19 | 02111-1307, USA. |
| 20 | |
| 21 | The GNU General Public License is contained in the file COPYING. |
| 22 | */ |
| 23 | |
| 24 | |
sewardj | e0744f0 | 2007-12-01 02:09:50 +0000 | [diff] [blame] | 25 | #include "drd_error.h" |
| 26 | #include "drd_segment.h" |
| 27 | #include "drd_thread.h" |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 28 | #include "pub_tool_basics.h" // Addr, SizeT |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 29 | #include "pub_tool_libcassert.h" // tl_assert() |
| 30 | #include "pub_tool_libcbase.h" // VG_(strlen)() |
| 31 | #include "pub_tool_libcprint.h" // VG_(printf)() |
tom | da3fdba | 2008-01-04 23:57:15 +0000 | [diff] [blame] | 32 | #include "pub_tool_machine.h" // VG_(get_SP)() |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 33 | #include "pub_tool_mallocfree.h" // VG_(malloc)(), VG_(free)() |
sewardj | e0744f0 | 2007-12-01 02:09:50 +0000 | [diff] [blame] | 34 | #include "pub_tool_threadstate.h" // VG_INVALID_THREADID |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 35 | |
| 36 | |
bart | e278ab5 | 2012-01-24 18:28:55 +0000 | [diff] [blame] | 37 | /* Global variables. */ |
| 38 | |
bart | 91b7ec3 | 2012-01-25 20:36:27 +0000 | [diff] [blame] | 39 | Segment* DRD_(g_sg_list); |
bart | e278ab5 | 2012-01-24 18:28:55 +0000 | [diff] [blame] | 40 | |
| 41 | |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 42 | /* Local variables. */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 43 | |
bart | 1a3b0b3 | 2009-05-03 17:07:34 +0000 | [diff] [blame] | 44 | static ULong s_segment_merge_count; |
bart | 2adfc2a | 2009-03-12 18:38:00 +0000 | [diff] [blame] | 45 | static ULong s_segments_created_count; |
| 46 | static ULong s_segments_alive_count; |
| 47 | static ULong s_max_segments_alive_count; |
| 48 | static Bool s_trace_segment; |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 49 | |
| 50 | |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 51 | /* Function definitions. */ |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 52 | |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 53 | /** |
| 54 | * Initialize the memory 'sg' points at. |
bart | 2adfc2a | 2009-03-12 18:38:00 +0000 | [diff] [blame] | 55 | * |
| 56 | * @note The creator and created thread ID's may be equal. |
| 57 | * @note This function copies the vector clock of thread 'creator', a technique |
| 58 | * also known as clock snooping. This will only work reliably if the thread |
| 59 | * that called pthread_create() waits until the created thread has copied |
| 60 | * the vector clock. |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 61 | */ |
bart | 2adfc2a | 2009-03-12 18:38:00 +0000 | [diff] [blame] | 62 | static void sg_init(Segment* const sg, |
| 63 | const DrdThreadId creator, |
| 64 | const DrdThreadId created) |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 65 | { |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 66 | Segment* creator_sg; |
| 67 | ThreadId vg_created = DRD_(DrdThreadIdToVgThreadId)(created); |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 68 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 69 | tl_assert(sg); |
| 70 | tl_assert(creator == DRD_INVALID_THREADID |
| 71 | || DRD_(IsValidDrdThreadId)(creator)); |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 72 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 73 | creator_sg = (creator != DRD_INVALID_THREADID |
| 74 | ? DRD_(thread_get_segment)(creator) : 0); |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 75 | |
bart | 91b7ec3 | 2012-01-25 20:36:27 +0000 | [diff] [blame] | 76 | sg->g_next = NULL; |
| 77 | sg->g_prev = NULL; |
| 78 | sg->thr_next = NULL; |
| 79 | sg->thr_prev = NULL; |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 80 | sg->tid = created; |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 81 | sg->refcnt = 1; |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 82 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 83 | if (vg_created != VG_INVALID_THREADID && VG_(get_SP)(vg_created) != 0) |
| 84 | sg->stacktrace = VG_(record_ExeContext)(vg_created, 0); |
| 85 | else |
| 86 | sg->stacktrace = 0; |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 87 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 88 | if (creator_sg) |
| 89 | DRD_(vc_copy)(&sg->vc, &creator_sg->vc); |
| 90 | else |
| 91 | DRD_(vc_init)(&sg->vc, 0, 0); |
| 92 | DRD_(vc_increment)(&sg->vc, created); |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 93 | DRD_(bm_init)(&sg->bm); |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 94 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 95 | if (s_trace_segment) |
| 96 | { |
florian | 19f91bb | 2012-11-10 22:29:54 +0000 | [diff] [blame] | 97 | HChar* vc; |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 98 | |
| 99 | vc = DRD_(vc_aprint)(&sg->vc); |
bart | 4565e27 | 2010-03-07 20:05:58 +0000 | [diff] [blame] | 100 | VG_(message)(Vg_DebugMsg, "New segment for thread %d with vc %s\n", |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 101 | created, vc); |
| 102 | VG_(free)(vc); |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 103 | } |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 104 | } |
| 105 | |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 106 | /** Deallocate the memory that was allocated by sg_init(). */ |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 107 | static void DRD_(sg_cleanup)(Segment* const sg) |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 108 | { |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 109 | tl_assert(sg); |
| 110 | tl_assert(sg->refcnt == 0); |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 111 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 112 | DRD_(vc_cleanup)(&sg->vc); |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 113 | DRD_(bm_cleanup)(&sg->bm); |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 114 | } |
| 115 | |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 116 | /** Allocate and initialize a new segment. */ |
bart | 2adfc2a | 2009-03-12 18:38:00 +0000 | [diff] [blame] | 117 | Segment* DRD_(sg_new)(const DrdThreadId creator, const DrdThreadId created) |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 118 | { |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 119 | Segment* sg; |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 120 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 121 | s_segments_created_count++; |
| 122 | s_segments_alive_count++; |
| 123 | if (s_max_segments_alive_count < s_segments_alive_count) |
| 124 | s_max_segments_alive_count = s_segments_alive_count; |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 125 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 126 | sg = VG_(malloc)("drd.segment.sn.1", sizeof(*sg)); |
| 127 | tl_assert(sg); |
| 128 | sg_init(sg, creator, created); |
bart | 91b7ec3 | 2012-01-25 20:36:27 +0000 | [diff] [blame] | 129 | if (DRD_(g_sg_list)) { |
| 130 | DRD_(g_sg_list)->g_prev = sg; |
| 131 | sg->g_next = DRD_(g_sg_list); |
| 132 | } |
| 133 | DRD_(g_sg_list) = sg; |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 134 | return sg; |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 135 | } |
| 136 | |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 137 | static void DRD_(sg_delete)(Segment* const sg) |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 138 | { |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 139 | if (DRD_(sg_get_trace)()) |
| 140 | { |
florian | 19f91bb | 2012-11-10 22:29:54 +0000 | [diff] [blame] | 141 | HChar* vc; |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 142 | |
| 143 | vc = DRD_(vc_aprint)(&sg->vc); |
bart | 4565e27 | 2010-03-07 20:05:58 +0000 | [diff] [blame] | 144 | VG_(message)(Vg_DebugMsg, "Discarding the segment with vector clock %s\n", |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 145 | vc); |
| 146 | VG_(free)(vc); |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 147 | } |
bart | 68edad5 | 2008-02-24 18:21:12 +0000 | [diff] [blame] | 148 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 149 | s_segments_alive_count--; |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 150 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 151 | tl_assert(sg); |
bart | 91b7ec3 | 2012-01-25 20:36:27 +0000 | [diff] [blame] | 152 | if (sg->g_next) |
| 153 | sg->g_next->g_prev = sg->g_prev; |
| 154 | if (sg->g_prev) |
| 155 | sg->g_prev->g_next = sg->g_next; |
| 156 | else |
| 157 | DRD_(g_sg_list) = sg->g_next; |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 158 | DRD_(sg_cleanup)(sg); |
| 159 | VG_(free)(sg); |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 160 | } |
| 161 | |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 162 | /** Increment the reference count of the specified segment. */ |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 163 | Segment* DRD_(sg_get)(Segment* const sg) |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 164 | { |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 165 | tl_assert(sg); |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 166 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 167 | sg->refcnt++; |
| 168 | return sg; |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 169 | } |
| 170 | |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 171 | /** |
| 172 | * Decrement the reference count of the specified segment and deallocate the |
| 173 | * segment if the reference count became zero. |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 174 | */ |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 175 | void DRD_(sg_put)(Segment* const sg) |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 176 | { |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 177 | if (sg == 0) |
| 178 | return; |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 179 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 180 | if (s_trace_segment) |
| 181 | { |
florian | 19f91bb | 2012-11-10 22:29:54 +0000 | [diff] [blame] | 182 | HChar* vc; |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 183 | |
| 184 | vc = DRD_(vc_aprint)(&sg->vc); |
| 185 | VG_(message)(Vg_DebugMsg, |
bart | 4565e27 | 2010-03-07 20:05:58 +0000 | [diff] [blame] | 186 | "Decrementing segment reference count %d -> %d with vc %s\n", |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 187 | sg->refcnt, sg->refcnt - 1, vc); |
| 188 | VG_(free)(vc); |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 189 | } |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 190 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 191 | tl_assert(sg->refcnt >= 1); |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 192 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 193 | if (--sg->refcnt == 0) |
| 194 | { |
| 195 | DRD_(sg_delete)(sg); |
| 196 | } |
bart | a2b6e1b | 2008-03-17 18:32:39 +0000 | [diff] [blame] | 197 | } |
| 198 | |
bart | a9c3739 | 2008-03-22 09:38:48 +0000 | [diff] [blame] | 199 | /** Merge sg1 and sg2 into sg1. */ |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 200 | void DRD_(sg_merge)(Segment* const sg1, Segment* const sg2) |
bart | a9c3739 | 2008-03-22 09:38:48 +0000 | [diff] [blame] | 201 | { |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 202 | tl_assert(sg1); |
| 203 | tl_assert(sg1->refcnt == 1); |
| 204 | tl_assert(sg2); |
| 205 | tl_assert(sg2->refcnt == 1); |
bart | a9c3739 | 2008-03-22 09:38:48 +0000 | [diff] [blame] | 206 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 207 | if (s_trace_segment) |
| 208 | { |
florian | 19f91bb | 2012-11-10 22:29:54 +0000 | [diff] [blame] | 209 | HChar *vc1, *vc2; |
bart | a9c3739 | 2008-03-22 09:38:48 +0000 | [diff] [blame] | 210 | |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 211 | vc1 = DRD_(vc_aprint)(&sg1->vc); |
| 212 | vc2 = DRD_(vc_aprint)(&sg2->vc); |
| 213 | |
bart | 4565e27 | 2010-03-07 20:05:58 +0000 | [diff] [blame] | 214 | VG_(message)(Vg_DebugMsg, |
| 215 | "Merging segments with vector clocks %s and %s\n", vc1, vc2); |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 216 | VG_(free)(vc1); |
| 217 | VG_(free)(vc2); |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 218 | } |
bart | a9c3739 | 2008-03-22 09:38:48 +0000 | [diff] [blame] | 219 | |
bart | 1a3b0b3 | 2009-05-03 17:07:34 +0000 | [diff] [blame] | 220 | s_segment_merge_count++; |
| 221 | |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 222 | // Keep sg1->stacktrace. |
| 223 | // Keep sg1->vc. |
| 224 | // Merge sg2->bm into sg1->bm. |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 225 | DRD_(bm_merge2)(&sg1->bm, &sg2->bm); |
bart | a9c3739 | 2008-03-22 09:38:48 +0000 | [diff] [blame] | 226 | } |
| 227 | |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 228 | /** Print the vector clock and the bitmap of the specified segment. */ |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 229 | void DRD_(sg_print)(Segment* const sg) |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 230 | { |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 231 | tl_assert(sg); |
| 232 | VG_(printf)("vc: "); |
| 233 | DRD_(vc_print)(&sg->vc); |
| 234 | VG_(printf)("\n"); |
bart | 8f822af | 2009-06-08 18:20:42 +0000 | [diff] [blame] | 235 | DRD_(bm_print)(&sg->bm); |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 236 | } |
| 237 | |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 238 | /** Query whether segment tracing has been enabled. */ |
| 239 | Bool DRD_(sg_get_trace)(void) |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 240 | { |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 241 | return s_trace_segment; |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 242 | } |
| 243 | |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 244 | /** Enable or disable segment tracing. */ |
| 245 | void DRD_(sg_set_trace)(Bool const trace_segment) |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 246 | { |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 247 | tl_assert(trace_segment == False || trace_segment == True); |
| 248 | s_trace_segment = trace_segment; |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 249 | } |
| 250 | |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 251 | ULong DRD_(sg_get_segments_created_count)(void) |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 252 | { |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 253 | return s_segments_created_count; |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 254 | } |
| 255 | |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 256 | ULong DRD_(sg_get_segments_alive_count)(void) |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 257 | { |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 258 | return s_segments_alive_count; |
bart | 7102f10 | 2008-03-17 17:37:53 +0000 | [diff] [blame] | 259 | } |
| 260 | |
bart | 62ada3f | 2009-02-14 17:19:58 +0000 | [diff] [blame] | 261 | ULong DRD_(sg_get_max_segments_alive_count)(void) |
bart | 7102f10 | 2008-03-17 17:37:53 +0000 | [diff] [blame] | 262 | { |
bart | bedfd23 | 2009-03-26 19:07:15 +0000 | [diff] [blame] | 263 | return s_max_segments_alive_count; |
sewardj | af44c82 | 2007-11-25 14:01:38 +0000 | [diff] [blame] | 264 | } |
bart | 1a3b0b3 | 2009-05-03 17:07:34 +0000 | [diff] [blame] | 265 | |
| 266 | ULong DRD_(sg_get_segment_merge_count)(void) |
| 267 | { |
| 268 | return s_segment_merge_count; |
| 269 | } |