blob: 9da1cd438a7902953d59dabccec64ff74b40de53 [file] [log] [blame]
sewardjf98e1c02008-10-25 16:22:41 +00001
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
sewardj03f8d3f2012-08-05 15:46:46 +000011 Copyright (C) 2007-2012 OpenWorks Ltd
sewardjf98e1c02008-10-25 16:22:41 +000012 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
florian54fe2022012-10-27 23:07:42 +000045void* HG_(zalloc) ( const HChar* cc, SizeT n )
sewardjf98e1c02008-10-25 16:22:41 +000046{
47 void* p;
48 tl_assert(n > 0);
49 p = VG_(malloc)( cc, n );
50 tl_assert(p);
51 VG_(memset)(p, 0, n);
52 return p;
53}
54
55void HG_(free) ( void* p )
56{
57 tl_assert(p);
58 VG_(free)(p);
59}
60
florian19f91bb2012-11-10 22:29:54 +000061HChar* HG_(strdup) ( const HChar* cc, const HChar* s )
sewardjf98e1c02008-10-25 16:22:41 +000062{
63 return VG_(strdup)( cc, s );
64}
65
66
67/*----------------------------------------------------------------*/
68/*--- Command line options ---*/
69/*----------------------------------------------------------------*/
70
71/* Description of these flags is in hg_basics.h. */
72
sewardj849b0ed2008-12-21 10:43:10 +000073Bool HG_(clo_track_lockorders) = True;
sewardjf98e1c02008-10-25 16:22:41 +000074
sewardj849b0ed2008-12-21 10:43:10 +000075Bool HG_(clo_cmp_race_err_addrs) = False;
sewardjf98e1c02008-10-25 16:22:41 +000076
sewardj23f12002009-07-24 08:45:08 +000077UWord HG_(clo_history_level) = 2;
sewardjf98e1c02008-10-25 16:22:41 +000078
sewardj849b0ed2008-12-21 10:43:10 +000079UWord HG_(clo_conflict_cache_size) = 1000000;
sewardjf98e1c02008-10-25 16:22:41 +000080
sewardj849b0ed2008-12-21 10:43:10 +000081Word HG_(clo_sanity_flags) = 0;
sewardjf98e1c02008-10-25 16:22:41 +000082
sewardj622fe492011-03-11 21:06:59 +000083Bool HG_(clo_free_is_write) = False;
84
sewardjffce8152011-06-24 10:09:41 +000085UWord HG_(clo_vts_pruning) = 1;
86
87Bool HG_(clo_check_stack_refs) = True;
sewardjf98e1c02008-10-25 16:22:41 +000088
89/*--------------------------------------------------------------------*/
90/*--- end hg_basics.c ---*/
91/*--------------------------------------------------------------------*/