source: trunk/gsdl/src/mgpp/lib/memlib.cpp@ 855

Last change on this file since 855 was 855, checked in by sjboddie, 24 years ago

Rodgers new C++ mg

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1/**************************************************************************
2 *
3 * memlib.c -- Malloc wrappers
4 * Copyright (C) 1994 Neil Sharman
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU 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., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *
20 * $Id: memlib.cpp 855 2000-01-14 02:17:52Z sjboddie $
21 *
22 **************************************************************************/
23
24/*
25 $Log$
26 Revision 1.1 2000/01/14 02:17:09 sjboddie
27 Rodgers new C++ mg
28
29 Revision 1.2 1999/10/17 23:39:45 cs025
30 Changes to eradicate Xmalloc etc
31
32 Revision 1.1 1999/10/11 02:55:15 cs025
33 Base install of MG-PP
34
35 Revision 1.1 1999/08/10 21:16:54 sjboddie
36 renamed mg-1.3d directory mg
37
38 Revision 1.1 1998/11/17 09:32:10 rjmcnab
39 *** empty log message ***
40
41 * Revision 1.1 1994/08/22 00:24:47 tes
42 * Initial placement under CVS.
43 *
44 */
45
46static char *RCSID = "$Id: memlib.cpp 855 2000-01-14 02:17:52Z sjboddie $";
47
48
49#include "sysfuncs.h"
50#include "memlib.h"
51
52/* Defined as strdup is not an ANSI function */
53char *
54my_strdup(const char *str)
55{
56 char *ret_str = new char[strlen(str)+1];
57 if (ret_str) return strcpy(ret_str, str);
58 else return (char*) 0;
59}
60
61
62Malloc_func Xmalloc = malloc;
63
64Realloc_func Xrealloc = realloc;
65
66Free_func Xfree = free;
67
68Strdup_func Xstrdup = my_strdup;
Note: See TracBrowser for help on using the repository browser.