sewardj | f98e1c0 | 2008-10-25 16:22:41 +0000 | [diff] [blame] | 1 | |
| 2 | /*--------------------------------------------------------------------*/ |
| 3 | /*--- Basic definitions for all of Helgrind. ---*/ |
| 4 | /*--- hg_basics.c ---*/ |
| 5 | /*--------------------------------------------------------------------*/ |
| 6 | |
| 7 | /* |
| 8 | This file is part of Helgrind, a Valgrind tool for detecting errors |
| 9 | in threaded programs. |
| 10 | |
sewardj | b3a1e4b | 2015-08-21 11:32:26 +0000 | [diff] [blame] | 11 | Copyright (C) 2007-2015 OpenWorks Ltd |
sewardj | f98e1c0 | 2008-10-25 16:22:41 +0000 | [diff] [blame] | 12 | info@open-works.co.uk |
| 13 | |
| 14 | This program is free software; you can redistribute it and/or |
| 15 | modify it under the terms of the GNU General Public License as |
| 16 | published by the Free Software Foundation; either version 2 of the |
| 17 | License, or (at your option) any later version. |
| 18 | |
| 19 | This program is distributed in the hope that it will be useful, but |
| 20 | WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 22 | General Public License for more details. |
| 23 | |
| 24 | You should have received a copy of the GNU General Public License |
| 25 | along with this program; if not, write to the Free Software |
| 26 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
| 27 | 02111-1307, USA. |
| 28 | |
| 29 | The GNU General Public License is contained in the file COPYING. |
| 30 | */ |
| 31 | |
| 32 | #include "pub_tool_basics.h" |
| 33 | #include "pub_tool_libcbase.h" |
| 34 | #include "pub_tool_libcassert.h" |
| 35 | #include "pub_tool_mallocfree.h" |
| 36 | #include "pub_tool_threadstate.h" |
| 37 | |
| 38 | #include "hg_basics.h" /* self */ |
| 39 | |
| 40 | |
| 41 | /*----------------------------------------------------------------*/ |
| 42 | /*--- Very basic stuff ---*/ |
| 43 | /*----------------------------------------------------------------*/ |
| 44 | |
florian | 54fe202 | 2012-10-27 23:07:42 +0000 | [diff] [blame] | 45 | void* HG_(zalloc) ( const HChar* cc, SizeT n ) |
sewardj | f98e1c0 | 2008-10-25 16:22:41 +0000 | [diff] [blame] | 46 | { |
| 47 | void* p; |
| 48 | tl_assert(n > 0); |
| 49 | p = VG_(malloc)( cc, n ); |
sewardj | f98e1c0 | 2008-10-25 16:22:41 +0000 | [diff] [blame] | 50 | VG_(memset)(p, 0, n); |
| 51 | return p; |
| 52 | } |
| 53 | |
| 54 | void HG_(free) ( void* p ) |
| 55 | { |
| 56 | tl_assert(p); |
| 57 | VG_(free)(p); |
| 58 | } |
| 59 | |
florian | 19f91bb | 2012-11-10 22:29:54 +0000 | [diff] [blame] | 60 | HChar* HG_(strdup) ( const HChar* cc, const HChar* s ) |
sewardj | f98e1c0 | 2008-10-25 16:22:41 +0000 | [diff] [blame] | 61 | { |
| 62 | return VG_(strdup)( cc, s ); |
| 63 | } |
| 64 | |
| 65 | |
| 66 | /*----------------------------------------------------------------*/ |
| 67 | /*--- Command line options ---*/ |
| 68 | /*----------------------------------------------------------------*/ |
| 69 | |
| 70 | /* Description of these flags is in hg_basics.h. */ |
| 71 | |
sewardj | 849b0ed | 2008-12-21 10:43:10 +0000 | [diff] [blame] | 72 | Bool HG_(clo_track_lockorders) = True; |
sewardj | f98e1c0 | 2008-10-25 16:22:41 +0000 | [diff] [blame] | 73 | |
sewardj | 849b0ed | 2008-12-21 10:43:10 +0000 | [diff] [blame] | 74 | Bool HG_(clo_cmp_race_err_addrs) = False; |
sewardj | f98e1c0 | 2008-10-25 16:22:41 +0000 | [diff] [blame] | 75 | |
sewardj | 23f1200 | 2009-07-24 08:45:08 +0000 | [diff] [blame] | 76 | UWord HG_(clo_history_level) = 2; |
sewardj | f98e1c0 | 2008-10-25 16:22:41 +0000 | [diff] [blame] | 77 | |
philippe | 328d662 | 2015-05-25 17:24:27 +0000 | [diff] [blame] | 78 | UWord HG_(clo_conflict_cache_size) = 2000000; |
sewardj | f98e1c0 | 2008-10-25 16:22:41 +0000 | [diff] [blame] | 79 | |
florian | 5e5cb00 | 2015-08-03 21:21:42 +0000 | [diff] [blame] | 80 | UWord HG_(clo_sanity_flags) = 0; |
sewardj | f98e1c0 | 2008-10-25 16:22:41 +0000 | [diff] [blame] | 81 | |
sewardj | 622fe49 | 2011-03-11 21:06:59 +0000 | [diff] [blame] | 82 | Bool HG_(clo_free_is_write) = False; |
| 83 | |
sewardj | ffce815 | 2011-06-24 10:09:41 +0000 | [diff] [blame] | 84 | UWord HG_(clo_vts_pruning) = 1; |
| 85 | |
| 86 | Bool HG_(clo_check_stack_refs) = True; |
sewardj | f98e1c0 | 2008-10-25 16:22:41 +0000 | [diff] [blame] | 87 | |
| 88 | /*--------------------------------------------------------------------*/ |
| 89 | /*--- end hg_basics.c ---*/ |
| 90 | /*--------------------------------------------------------------------*/ |