blob: eecbe583aed1faf8f1bc0a68b7ab473eff8f721a [file] [log] [blame]
bartbedfd232009-03-26 19:07:15 +00001/* -*- mode: C; c-basic-offset: 3; -*- */
sewardjaf44c822007-11-25 14:01:38 +00002/*
bart86562bd2009-02-16 19:43:56 +00003 This file is part of drd, a thread error detector.
sewardjaf44c822007-11-25 14:01:38 +00004
bart86562bd2009-02-16 19:43:56 +00005 Copyright (C) 2006-2009 Bart Van Assche <bart.vanassche@gmail.com>.
sewardjaf44c822007-11-25 14:01:38 +00006
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 02111-1307, USA.
21
22 The GNU General Public License is contained in the file COPYING.
23*/
24
25#ifndef __MALLOC_WRAPPERS_H
26#define __MALLOC_WRAPPERS_H
27
28
bart246fbf22009-02-15 14:46:17 +000029#include "drd_basics.h" /* DRD_() */
30#include "pub_tool_basics.h" /* Bool */
31#include "pub_tool_execontext.h" /* ExeContext */
sewardjaf44c822007-11-25 14:01:38 +000032
33
bart513d8cf2009-06-04 09:57:54 +000034typedef void (*StartUsingMem)(const Addr a1, const SizeT len, UInt ec_uniq);
35typedef void (*StopUsingMem)(const Addr a1, const SizeT len);
sewardjaf44c822007-11-25 14:01:38 +000036
37
bart246fbf22009-02-15 14:46:17 +000038void DRD_(register_malloc_wrappers)(const StartUsingMem start_callback,
39 const StopUsingMem stop_callback);
bartba0818d2009-05-01 12:21:39 +000040void DRD_(malloclike_block)(const ThreadId tid, const Addr p, const SizeT size);
41Bool DRD_(freelike_block)(const ThreadId tid, const Addr p);
bart246fbf22009-02-15 14:46:17 +000042Bool DRD_(heap_addrinfo)(Addr const a,
43 Addr* const data,
44 SizeT* const size,
45 ExeContext** const where);
46void DRD_(print_malloc_stats)(void);
sewardjaf44c822007-11-25 14:01:38 +000047
48
49#endif // __MALLOC_WRAPPERS_H