/[dtapublic]/projs/trunk/shared_source/c_tcl_base_7_5_w_mods/tclalloc.c
ViewVC logotype

Diff of /projs/trunk/shared_source/c_tcl_base_7_5_w_mods/tclalloc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 70 by dashley, Mon Oct 31 00:57:34 2016 UTC revision 71 by dashley, Sat Nov 5 11:07:06 2016 UTC
# Line 1  Line 1 
1  /* $Header$ */  /* $Header$ */
2    
3  #define MODULE_TCLALLOC  #define MODULE_TCLALLOC
4    
5  #include <malloc.h>  #include <malloc.h>
6    
7  #include "tclalloc.h"  #include "tclalloc.h"
8    
9    
10   /*   /*
11   *----------------------------------------------------------------------   *----------------------------------------------------------------------
12   *   *
13   * TclpAlloc --   * TclpAlloc --
14   *   *
15   *      Allocate more memory.   *      Allocate more memory.
16   *   *
17   * Results:   * Results:
18   *      None.   *      None.
19   *   *
20   * Side effects:   * Side effects:
21   *      None.   *      None.
22   *   *
23   *----------------------------------------------------------------------   *----------------------------------------------------------------------
24   */   */
25    
26  char *TclpAlloc(unsigned int nbytes)  char *TclpAlloc(unsigned int nbytes)
27  {  {
28      return (char*) malloc(nbytes);      return (char*) malloc(nbytes);
29  }  }
30    
31    
32  /*  /*
33   *----------------------------------------------------------------------   *----------------------------------------------------------------------
34   *   *
35   * TclpFree --   * TclpFree --
36   *   *
37   *      Free memory.   *      Free memory.
38   *   *
39   * Results:   * Results:
40   *      None.   *      None.
41   *   *
42   * Side effects:   * Side effects:
43   *      None.   *      None.
44   *   *
45   *----------------------------------------------------------------------   *----------------------------------------------------------------------
46   */   */
47    
48  void TclpFree(char *cp)  void TclpFree(char *cp)
49  {    {  
50      free(cp);      free(cp);
51      return;      return;
52  }  }
53    
54    
55   /*   /*
56   *----------------------------------------------------------------------   *----------------------------------------------------------------------
57   *   *
58   * TclpCalloc --   * TclpCalloc --
59   *   *
60   *      Allocate array of memory.   *      Allocate array of memory.
61   *   *
62   * Results:   * Results:
63   *      None.   *      None.
64   *   *
65   * Side effects:   * Side effects:
66   *      None.   *      None.
67   *   *
68   *----------------------------------------------------------------------   *----------------------------------------------------------------------
69   */   */
70    
71  char *TclpCalloc(size_t num, size_t size)  char *TclpCalloc(size_t num, size_t size)
72  {  {
73      return (char*) calloc(num, size);      return (char*) calloc(num, size);
74  }  }
75    
76    
77  /*  /*
78   *----------------------------------------------------------------------   *----------------------------------------------------------------------
79   *   *
80   * TclpRealloc --   * TclpRealloc --
81   *   *
82   *      Reallocate memory.   *      Reallocate memory.
83   *   *
84   * Results:   * Results:
85   *      None.   *      None.
86   *   *
87   * Side effects:   * Side effects:
88   *      None.   *      None.
89   *   *
90   *----------------------------------------------------------------------   *----------------------------------------------------------------------
91   */   */
92    
93  char *TclpRealloc(char *cp, unsigned int nbytes)  char *TclpRealloc(char *cp, unsigned int nbytes)
94  {    {  
95      return (char*) realloc(cp, nbytes);      return (char*) realloc(cp, nbytes);
96  }  }
97    
98    
99  /*  /*
100   *----------------------------------------------------------------------   *----------------------------------------------------------------------
101   *   *
102   * TclpCversion --   * TclpCversion --
103   *   *
104   *      Returns the PVCS version control string for the .C file.     *      Returns the PVCS version control string for the .C file.  
105   *  This is a constant string and may not be modified.   *  This is a constant string and may not be modified.
106   *   *
107   * Side effects:   * Side effects:
108   *      None.   *      None.
109   *   *
110   *----------------------------------------------------------------------   *----------------------------------------------------------------------
111   */   */
112    
113  const char *TclpCversion(void)  const char *TclpCversion(void)
114  {    {  
115      return ("$Header$");      return ("$Header$");
116  }  }
117    
118    
119  /*  /*
120   *----------------------------------------------------------------------   *----------------------------------------------------------------------
121   *   *
122   * TclpHversion --   * TclpHversion --
123   *   *
124   *      Returns the PVCS version control string for the .H file.     *      Returns the PVCS version control string for the .H file.  
125   *  This is a constant string and may not be modified.   *  This is a constant string and may not be modified.
126   *   *
127   * Side effects:   * Side effects:
128   *      None.   *      None.
129   *   *
130   *----------------------------------------------------------------------   *----------------------------------------------------------------------
131   */   */
132    
133  const char *TclpHversion(void)  const char *TclpHversion(void)
134  {    {  
135      return (TCLALLOC_H_VERSION);      return (TCLALLOC_H_VERSION);
136  }  }
137    
138    
139  /*  /*
140   * $Log: tclalloc.c,v $   * $Log: tclalloc.c,v $
141   * Revision 1.4  2001/07/15 06:44:32  dtashley   * Revision 1.4  2001/07/15 06:44:32  dtashley
142   * Keyword expansion mistake corrected.   * Keyword expansion mistake corrected.
143   *   *
144   * Revision 1.3  2001/07/15 06:40:10  dtashley   * Revision 1.3  2001/07/15 06:40:10  dtashley
145   * Adaptation of GNU arbitrary-size integer package integrated into IjuScripter   * Adaptation of GNU arbitrary-size integer package integrated into IjuScripter
146   * and IjuConsole.   * and IjuConsole.
147   *   *
148   * Revision 1.2  2001/07/15 06:07:15  dtashley   * Revision 1.2  2001/07/15 06:07:15  dtashley
149   * Moved out of binary mode, preparing for use with CVS.   * Moved out of binary mode, preparing for use with CVS.
150   */   */
151  /* $History: tclalloc.c $  /* $History: tclalloc.c $
152   *   *
153   * *****************  Version 1  *****************   * *****************  Version 1  *****************
154   * User: Dtashley     Date: 1/02/01    Time: 12:16a   * User: Dtashley     Date: 1/02/01    Time: 12:16a
155   * Created in $/IjuScripter, IjuConsole/Source/Tcl Base   * Created in $/IjuScripter, IjuConsole/Source/Tcl Base
156   * Initial check-in.   * Initial check-in.
157   */   */
158    
159  /*************************************************************************/  /*************************************************************************/
160  /* Original copyright notice below.   This must be retained in the       */  /* Original copyright notice below.   This must be retained in the       */
161  /* source code.                                                          */  /* source code.                                                          */
162  /*************************************************************************/  /*************************************************************************/
163    
164  /*  /*
165   * tclAlloc.c --   * tclAlloc.c --
166   *   *
167   *      This is a very fast storage allocator.  It allocates blocks of a   *      This is a very fast storage allocator.  It allocates blocks of a
168   *      small number of different sizes, and keeps free lists of each size.   *      small number of different sizes, and keeps free lists of each size.
169   *      Blocks that don't exactly fit are passed up to the next larger size.   *      Blocks that don't exactly fit are passed up to the next larger size.
170   *      Blocks over a certain size are directly allocated from the system.   *      Blocks over a certain size are directly allocated from the system.
171   *   *
172   * Copyright (c) 1983 Regents of the University of California.   * Copyright (c) 1983 Regents of the University of California.
173   * Copyright (c) 1996-1997 Sun Microsystems, Inc.   * Copyright (c) 1996-1997 Sun Microsystems, Inc.
174   * Copyright (c) 1998-1999 by Scriptics Corporation.   * Copyright (c) 1998-1999 by Scriptics Corporation.
175   *   *
176   * Portions contributed by Chris Kingsley, Jack Jansen and Ray Johnson.   * Portions contributed by Chris Kingsley, Jack Jansen and Ray Johnson.
177   *   *
178   * See the file "license.terms" for information on usage and redistribution   * See the file "license.terms" for information on usage and redistribution
179   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
180   *   *
181   * RCS: @(#) $Id: tclalloc.c,v 1.4 2001/07/15 06:44:32 dtashley Exp $   * RCS: @(#) $Id: tclalloc.c,v 1.4 2001/07/15 06:44:32 dtashley Exp $
182   */   */
183    
184  /* End of tclalloc.c */  /* End of tclalloc.c */

Legend:
Removed from v.70  
changed lines
  Added in v.71

dashley@gmail.com
ViewVC Help
Powered by ViewVC 1.1.25