xref: /titanic_44/usr/src/tools/ctf/dwarf/common/pro_alloc.c (revision c3f7431d06a31d5689b27f508120a3bd357f251e)
1 /*
2 
3   Copyright (C) 2000,2004 Silicon Graphics, Inc.  All Rights Reserved.
4 
5   This program is free software; you can redistribute it and/or modify it
6   under the terms of version 2.1 of the GNU Lesser General Public License
7   as published by the Free Software Foundation.
8 
9   This program is distributed in the hope that it would be useful, but
10   WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 
13   Further, this software is distributed without any warranty that it is
14   free of the rightful claim of any third person regarding infringement
15   or the like.  Any license provided herein, whether implied or
16   otherwise, applies only to this software file.  Patent licenses, if
17   any, provided herein do not apply to combinations of this program with
18   other software, or any other product whatsoever.
19 
20   You should have received a copy of the GNU Lesser General Public
21   License along with this program; if not, write the Free Software
22   Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
23   USA.
24 
25   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
26   Mountain View, CA 94043, or:
27 
28   http://www.sgi.com
29 
30   For further information regarding this notice, see:
31 
32   http://oss.sgi.com/projects/GenInfo/NoticeExplan
33 
34 */
35 
36 
37 
38 #include "config.h"
39 #include "dwarf_incl.h"
40 #include <stdlib.h>
41 
42 /*
43 	The allocator wants to know which region
44 	this is to be in so it can allocate the new space
45 	with respect to the right region.
46 */
47  /*ARGSUSED*/
48     Dwarf_Ptr _dwarf_p_get_alloc(Dwarf_P_Debug dbg, Dwarf_Unsigned size)
49 {
50     void *sp;
51 
52     sp = malloc(size);
53     memset(sp,0, (int) size);
54     return sp;
55 }
56 
57 
58  /*ARGSUSED*/ void
59 dwarf_p_dealloc(void *space, Dwarf_Unsigned typ)
60 {
61     free(space);
62     return;
63 }
64 
65 
66 /* Essentially a stub for now. */
67  /*ARGSUSED*/ void
68 _dwarf_p_dealloc(Dwarf_P_Debug dbg, Dwarf_Small * ptr)
69 {
70     dwarf_p_dealloc(ptr, DW_DLA_STRING);
71 }
72