Back to index

texmacs  1.0.7.15
fast_alloc.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : fast_alloc.hpp
00004 * DESCRIPTION: see fast_alloc.cpp
00005 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef FAST_ALLOC_H
00013 #define FAST_ALLOC_H
00014 #include "tm_configure.hpp"
00015 #include <stdlib.h>
00016 
00017 #include "tm_ostream.hpp"
00018 
00019 #define BLOCK_SIZE 65536 // should be >>> MAX_FAST
00020 
00021 /******************************************************************************
00022 * Globals
00023 ******************************************************************************/
00024 
00025 extern char   alloc_table[MAX_FAST];
00026 extern char*  alloc_mem;
00027 extern size_t alloc_remains;
00028 extern int    allocated;
00029 extern int    large_uses;
00030 
00031 #define alloc_ptr(i) (*((void **) (alloc_table+i)))
00032 #define ind(ptr) (*((void **) ptr))
00033 
00034 /******************************************************************************
00035 * General purpose fast allocation routines
00036 ******************************************************************************/
00037 
00038 extern void* safe_malloc (register size_t s);
00039 extern void* enlarge_malloc (register size_t s);
00040 extern void* fast_alloc (register size_t s);
00041 extern void  fast_free (register void* ptr, register size_t s);
00042 extern void* fast_new (register size_t s);
00043 extern void  fast_delete (register void* ptr);
00044 
00045 extern int   mem_used ();
00046 extern void  mem_info ();
00047 
00048 /******************************************************************************
00049 * Fast new and delete
00050 ******************************************************************************/
00051 
00052 #if (!defined(NO_FAST_ALLOC)) && (!defined(X11TEXMACS))
00053 
00054 #ifdef OLD_GNU_COMPILER
00055 inline void* operator new   (register size_t s, void* loc) { return loc; }
00056 inline void* operator new[] (register size_t s, void* loc) { return loc; }
00057 #else
00058 #include <new>
00059 #endif
00060 
00061 template<typename C> inline C*
00062 tm_new () {
00063   void* ptr= fast_new (sizeof (C));
00064   (void) new (ptr) C ();
00065   return (C*) ptr;
00066 }
00067 
00068 template<typename C, typename A1> inline C*
00069 tm_new (const A1& a1) {
00070   void* ptr= fast_new (sizeof (C));
00071   (void) new (ptr) C (a1);
00072   return (C*) ptr;
00073 }
00074 
00075 template<typename C, typename A1, typename A2> inline C*
00076 tm_new (const A1& a1, const A2& a2) {
00077   void* ptr= fast_new (sizeof (C));
00078   (void) new (ptr) C (a1, a2);
00079   return (C*) ptr;
00080 }
00081 
00082 template<typename C, typename A1, typename A2> inline C*
00083 tm_new (const A1& a1, A2& a2) {
00084   void* ptr= fast_new (sizeof (C));
00085   (void) new (ptr) C (a1, a2);
00086   return (C*) ptr;
00087 }
00088 
00089 template<typename C, typename A1, typename A2> inline C*
00090 tm_new (A1& a1, const A2& a2) {
00091   void* ptr= fast_new (sizeof (C));
00092   (void) new (ptr) C (a1, a2);
00093   return (C*) ptr;
00094 }
00095 
00096 template<typename C, typename A1, typename A2> inline C*
00097 tm_new (A1& a1, A2& a2) {
00098   void* ptr= fast_new (sizeof (C));
00099   (void) new (ptr) C (a1, a2);
00100   return (C*) ptr;
00101 }
00102 
00103 template<typename C, typename A1, typename A2, typename A3> inline C*
00104 tm_new (const A1& a1, const A2& a2, const A3& a3) {
00105   void* ptr= fast_new (sizeof (C));
00106   (void) new (ptr) C (a1, a2, a3);
00107   return (C*) ptr;
00108 }
00109 
00110 template<typename C, typename A1, typename A2, typename A3> inline C*
00111 tm_new (const A1& a1, A2& a2, A3& a3) {
00112   void* ptr= fast_new (sizeof (C));
00113   (void) new (ptr) C (a1, a2, a3);
00114   return (C*) ptr;
00115 }
00116 
00117 template<typename C, typename A1, typename A2, typename A3> inline C*
00118 tm_new (A1& a1, A2& a2, const A3& a3) {
00119   void* ptr= fast_new (sizeof (C));
00120   (void) new (ptr) C (a1, a2, a3);
00121   return (C*) ptr;
00122 }
00123 
00124 template<typename C, typename A1, typename A2, typename A3> inline C*
00125 tm_new (A1& a1, A2& a2, A3& a3) {
00126   void* ptr= fast_new (sizeof (C));
00127   (void) new (ptr) C (a1, a2, a3);
00128   return (C*) ptr;
00129 }
00130 
00131 template<typename C, typename A1, typename A2, typename A3,
00132         typename A4> inline C*
00133 tm_new (const A1& a1, const A2& a2, const A3& a3,
00134        const A4& a4) {
00135   void* ptr= fast_new (sizeof (C));
00136   (void) new (ptr) C (a1, a2, a3, a4);
00137   return (C*) ptr;
00138 }
00139 
00140 template<typename C, typename A1, typename A2, typename A3,
00141         typename A4> inline C*
00142 tm_new (const A1& a1, A2& a2, A3& a3, A4& a4) {
00143   void* ptr= fast_new (sizeof (C));
00144   (void) new (ptr) C (a1, a2, a3, a4);
00145   return (C*) ptr;
00146 }
00147 
00148 template<typename C, typename A1, typename A2, typename A3,
00149         typename A4, typename A5> inline C*
00150 tm_new (const A1& a1, const A2& a2, const A3& a3,
00151        const A4& a4, const A5& a5) {
00152   void* ptr= fast_new (sizeof (C));
00153   (void) new (ptr) C (a1, a2, a3, a4, a5);
00154   return (C*) ptr;
00155 }
00156 
00157 template<typename C, typename A1, typename A2, typename A3,
00158         typename A4, typename A5> inline C*
00159 tm_new (const A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
00160   void* ptr= fast_new (sizeof (C));
00161   (void) new (ptr) C (a1, a2, a3, a4, a5);
00162   return (C*) ptr;
00163 }
00164 
00165 template<typename C, typename A1, typename A2, typename A3,
00166         typename A4, typename A5> inline C*
00167 tm_new (A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
00168   void* ptr= fast_new (sizeof (C));
00169   (void) new (ptr) C (a1, a2, a3, a4, a5);
00170   return (C*) ptr;
00171 }
00172 
00173 template<typename C, typename A1, typename A2, typename A3,
00174         typename A4, typename A5, typename A6> inline C*
00175 tm_new (const A1& a1, const A2& a2, const A3& a3,
00176        const A4& a4, const A5& a5, const A6& a6) {
00177   void* ptr= fast_new (sizeof (C));
00178   (void) new (ptr) C (a1, a2, a3, a4, a5, a6);
00179   return (C*) ptr;
00180 }
00181 
00182 template<typename C, typename A1, typename A2, typename A3,
00183         typename A4, typename A5, typename A6> inline C*
00184 tm_new (A1& a1, const A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
00185   void* ptr= fast_new (sizeof (C));
00186   (void) new (ptr) C (a1, a2, a3, a4, a5, a6);
00187   return (C*) ptr;
00188 }
00189 
00190 template<typename C, typename A1, typename A2, typename A3,
00191         typename A4, typename A5, typename A6, typename A7> inline C*
00192 tm_new (const A1& a1, const A2& a2, const A3& a3,
00193        const A4& a4, const A5& a5, const A6& a6,
00194        const A7& a7) {
00195   void* ptr= fast_new (sizeof (C));
00196   (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7);
00197   return (C*) ptr;
00198 }
00199 
00200 template<typename C, typename A1, typename A2, typename A3,
00201         typename A4, typename A5, typename A6, typename A7> inline C*
00202 tm_new (const A1& a1, const A2& a2, const A3& a3,
00203        A4& a4, const A5& a5, const A6& a6,
00204        const A7& a7) {
00205   void* ptr= fast_new (sizeof (C));
00206   (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7);
00207   return (C*) ptr;
00208 }
00209 
00210 template<typename C, typename A1, typename A2, typename A3,
00211         typename A4, typename A5, typename A6,
00212         typename A7, typename A8> inline C*
00213 tm_new (const A1& a1, const A2& a2, const A3& a3,
00214        const A4& a4, const A5& a5, const A6& a6,
00215        const A7& a7, const A8& a8) {
00216   void* ptr= fast_new (sizeof (C));
00217   (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8);
00218   return (C*) ptr;
00219 }
00220 
00221 template<typename C, typename A1, typename A2, typename A3,
00222         typename A4, typename A5, typename A6,
00223         typename A7, typename A8, typename A9> inline C*
00224 tm_new (const A1& a1, const A2& a2, const A3& a3,
00225        const A4& a4, const A5& a5, const A6& a6,
00226        const A7& a7, const A8& a8, const A9& a9) {
00227   void* ptr= fast_new (sizeof (C));
00228   (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9);
00229   return (C*) ptr;
00230 }
00231 
00232 template<typename C, typename A1, typename A2, typename A3,
00233         typename A4, typename A5, typename A6,
00234         typename A7, typename A8, typename A9,
00235         typename A10> inline C*
00236 tm_new (const A1& a1, const A2& a2, const A3& a3,
00237        const A4& a4, const A5& a5, const A6& a6,
00238        const A7& a7, const A8& a8, const A9& a9,
00239        const A10& a10) {
00240   void* ptr= fast_new (sizeof (C));
00241   (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
00242   return (C*) ptr;
00243 }
00244 
00245 template<typename C, typename A1, typename A2, typename A3,
00246         typename A4, typename A5, typename A6,
00247         typename A7, typename A8, typename A9,
00248         typename A10, typename A11> inline C*
00249 tm_new (const A1& a1, const A2& a2, const A3& a3,
00250        const A4& a4, const A5& a5, const A6& a6,
00251        const A7& a7, const A8& a8, const A9& a9,
00252        const A10& a10, const A11& a11) {
00253   void* ptr= fast_new (sizeof (C));
00254   (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
00255   return (C*) ptr;
00256 }
00257 
00258 template<typename C, typename A1, typename A2, typename A3,
00259         typename A4, typename A5, typename A6,
00260         typename A7, typename A8, typename A9,
00261         typename A10, typename A11, typename A12> inline C*
00262 tm_new (const A1& a1, const A2& a2, const A3& a3,
00263        const A4& a4, const A5& a5, const A6& a6,
00264        const A7& a7, const A8& a8, const A9& a9,
00265        const A10& a10, const A11& a11, const A12& a12) {
00266   void* ptr= fast_new (sizeof (C));
00267   (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
00268   return (C*) ptr;
00269 }
00270 
00271 template<typename C, typename A1, typename A2, typename A3,
00272         typename A4, typename A5, typename A6,
00273         typename A7, typename A8, typename A9,
00274         typename A10, typename A11, typename A12,
00275         typename A13> inline C*
00276 tm_new (const A1& a1, const A2& a2, const A3& a3,
00277        const A4& a4, const A5& a5, const A6& a6,
00278        const A7& a7, const A8& a8, const A9& a9,
00279        const A10& a10, const A11& a11, const A12& a12,
00280        const A13& a13) {
00281   void* ptr= fast_new (sizeof (C));
00282   (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
00283                     a11, a12, a13);
00284   return (C*) ptr;
00285 }
00286 
00287 template<typename C, typename A1, typename A2, typename A3,
00288         typename A4, typename A5, typename A6,
00289         typename A7, typename A8, typename A9,
00290         typename A10, typename A11, typename A12,
00291         typename A13, typename A14> inline C*
00292 tm_new (const A1& a1, const A2& a2, const A3& a3,
00293        const A4& a4, const A5& a5, const A6& a6,
00294        const A7& a7, const A8& a8, const A9& a9,
00295        const A10& a10, const A11& a11, const A12& a12,
00296        const A13& a13, const A14& a14) {
00297   void* ptr= fast_new (sizeof (C));
00298   (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
00299                     a11, a12, a13, a14);
00300   return (C*) ptr;
00301 }
00302 
00303 template<typename C, typename A1, typename A2, typename A3,
00304         typename A4, typename A5, typename A6,
00305         typename A7, typename A8, typename A9,
00306         typename A10, typename A11, typename A12,
00307         typename A13, typename A14, typename A15> inline C*
00308 tm_new (const A1& a1, const A2& a2, const A3& a3,
00309        const A4& a4, const A5& a5, const A6& a6,
00310        const A7& a7, const A8& a8, const A9& a9,
00311        const A10& a10, const A11& a11, const A12& a12,
00312        const A13& a13, const A14& a14, const A15& a15) {
00313   void* ptr= fast_new (sizeof (C));
00314   (void) new (ptr) C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
00315                     a11, a12, a13, a14, a15);
00316   return (C*) ptr;
00317 }
00318 
00319 template<typename C> inline void
00320 tm_delete (C* ptr) {
00321   ptr -> ~C ();
00322   fast_delete ((void*) ptr);
00323 }
00324 
00325 template<typename C> inline C*
00326 tm_new_array (int n) {
00327   void* ptr= fast_alloc (n * sizeof (C) + WORD_LENGTH);
00328   *((int*) ptr)= n;
00329   ptr= (void*) (((char*) ptr) + WORD_LENGTH);
00330   C* ctr= (C*) ptr;
00331   for (int i=0; i<n; i++, ctr++)
00332     (void) new ((void*) ctr) C ();
00333   return (C*) ptr;
00334 }
00335 
00336 template<typename C> inline void
00337 tm_delete_array (C* Ptr) {
00338   void* ptr= (void*) Ptr;
00339   ptr= (void*) (((char*) ptr) - WORD_LENGTH);
00340   int n= *((int*) ptr);
00341   C* ctr= Ptr+n-1;
00342   for (int i=0; i<n; i++, ctr--) ctr -> ~C();
00343   fast_free (ptr, n * sizeof (C) + WORD_LENGTH);
00344 }
00345 
00346 #endif // (!defined(NO_FAST_ALLOC)) && (!defined(X11TEXMACS))
00347 
00348 /******************************************************************************
00349 * Slow new and delete
00350 ******************************************************************************/
00351 
00352 #if defined(NO_FAST_ALLOC) || defined(X11TEXMACS)
00353 
00354 #ifndef NO_FAST_ALLOC
00355 #ifdef OS_IRIX
00356 void* operator new (register size_t s) throw(std::bad_alloc);
00357 void  operator delete (register void* ptr) throw();
00358 void* operator new[] (register size_t s) throw(std::bad_alloc);
00359 void  operator delete[] (register void* ptr) throw();
00360 #else
00361 void* operator new (register size_t s);
00362 void  operator delete (register void* ptr);
00363 void* operator new[] (register size_t s);
00364 void  operator delete[] (register void* ptr);
00365 #endif
00366 #endif // not defined NO_FAST_ALLOC
00367 
00368 template<typename C> inline C*
00369 tm_new () {
00370   return new C ();
00371 }
00372 
00373 template<typename C, typename A1> inline C*
00374 tm_new (const A1& a1) {
00375   return new C (a1);
00376 }
00377 
00378 template<typename C, typename A1, typename A2> inline C*
00379 tm_new (const A1& a1, const A2& a2) {
00380   return new C (a1, a2);
00381 }
00382 
00383 template<typename C, typename A1, typename A2> inline C*
00384 tm_new (const A1& a1, A2& a2) {
00385   return new C (a1, a2);
00386 }
00387 
00388 template<typename C, typename A1, typename A2> inline C*
00389 tm_new (A1& a1, const A2& a2) {
00390   return new C (a1, a2);
00391 }
00392 
00393 template<typename C, typename A1, typename A2> inline C*
00394 tm_new (A1& a1, A2& a2) {
00395   return new C (a1, a2);
00396 }
00397 
00398 template<typename C, typename A1, typename A2, typename A3> inline C*
00399 tm_new (const A1& a1, const A2& a2, const A3& a3) {
00400   return new C (a1, a2, a3);
00401 }
00402 
00403 template<typename C, typename A1, typename A2, typename A3> inline C*
00404 tm_new (const A1& a1, A2& a2, A3& a3) {
00405   return new C (a1, a2, a3);
00406 }
00407 
00408 template<typename C, typename A1, typename A2, typename A3> inline C*
00409 tm_new (A1& a1, A2& a2, const A3& a3) {
00410   return new C (a1, a2, a3);
00411 }
00412 
00413 template<typename C, typename A1, typename A2, typename A3> inline C*
00414 tm_new (A1& a1, A2& a2, A3& a3) {
00415   return new C (a1, a2, a3);
00416 }
00417 
00418 template<typename C, typename A1, typename A2, typename A3,
00419         typename A4> inline C*
00420 tm_new (const A1& a1, const A2& a2, const A3& a3,
00421        const A4& a4) {
00422   return new C (a1, a2, a3, a4);
00423 }
00424 
00425 template<typename C, typename A1, typename A2, typename A3,
00426         typename A4> inline C*
00427 tm_new (const A1& a1, A2& a2, A3& a3, A4& a4) {
00428   return new C (a1, a2, a3, a4);
00429 }
00430 
00431 template<typename C, typename A1, typename A2, typename A3,
00432         typename A4, typename A5> inline C*
00433 tm_new (const A1& a1, const A2& a2, const A3& a3,
00434        const A4& a4, const A5& a5) {
00435   return new C (a1, a2, a3, a4, a5);
00436 }
00437 
00438 template<typename C, typename A1, typename A2, typename A3,
00439         typename A4, typename A5> inline C*
00440 tm_new (const A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
00441   return new C (a1, a2, a3, a4, a5);
00442 }
00443 
00444 template<typename C, typename A1, typename A2, typename A3,
00445         typename A4, typename A5> inline C*
00446 tm_new (A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
00447   return new C (a1, a2, a3, a4, a5);
00448 }
00449 
00450 template<typename C, typename A1, typename A2, typename A3,
00451         typename A4, typename A5, typename A6> inline C*
00452 tm_new (const A1& a1, const A2& a2, const A3& a3,
00453        const A4& a4, const A5& a5, const A6& a6) {
00454   return new C (a1, a2, a3, a4, a5, a6);
00455 }
00456 
00457 template<typename C, typename A1, typename A2, typename A3,
00458         typename A4, typename A5, typename A6> inline C*
00459 tm_new (A1& a1, const A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
00460   return new C (a1, a2, a3, a4, a5, a6);
00461 }
00462 
00463 template<typename C, typename A1, typename A2, typename A3,
00464         typename A4, typename A5, typename A6, typename A7> inline C*
00465 tm_new (const A1& a1, const A2& a2, const A3& a3,
00466        const A4& a4, const A5& a5, const A6& a6,
00467        const A7& a7) {
00468   return new C (a1, a2, a3, a4, a5, a6, a7);
00469 }
00470 
00471 template<typename C, typename A1, typename A2, typename A3,
00472         typename A4, typename A5, typename A6, typename A7> inline C*
00473 tm_new (const A1& a1, const A2& a2, const A3& a3,
00474        A4& a4, const A5& a5, const A6& a6,
00475        const A7& a7) {
00476   return new C (a1, a2, a3, a4, a5, a6, a7);
00477 }
00478 
00479 template<typename C, typename A1, typename A2, typename A3,
00480         typename A4, typename A5, typename A6,
00481         typename A7, typename A8> inline C*
00482 tm_new (const A1& a1, const A2& a2, const A3& a3,
00483        const A4& a4, const A5& a5, const A6& a6,
00484        const A7& a7, const A8& a8) {
00485   return new C (a1, a2, a3, a4, a5, a6, a7, a8);
00486 }
00487 
00488 template<typename C, typename A1, typename A2, typename A3,
00489         typename A4, typename A5, typename A6,
00490         typename A7, typename A8, typename A9> inline C*
00491 tm_new (const A1& a1, const A2& a2, const A3& a3,
00492        const A4& a4, const A5& a5, const A6& a6,
00493        const A7& a7, const A8& a8, const A9& a9) {
00494   return new C (a1, a2, a3, a4, a5, a6, a7, a8, a9);
00495 }
00496 
00497 template<typename C, typename A1, typename A2, typename A3,
00498         typename A4, typename A5, typename A6,
00499         typename A7, typename A8, typename A9,
00500         typename A10> inline C*
00501 tm_new (const A1& a1, const A2& a2, const A3& a3,
00502        const A4& a4, const A5& a5, const A6& a6,
00503        const A7& a7, const A8& a8, const A9& a9,
00504        const A10& a10) {
00505   return new C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
00506 }
00507 
00508 template<typename C, typename A1, typename A2, typename A3,
00509         typename A4, typename A5, typename A6,
00510         typename A7, typename A8, typename A9,
00511         typename A10, typename A11> inline C*
00512 tm_new (const A1& a1, const A2& a2, const A3& a3,
00513        const A4& a4, const A5& a5, const A6& a6,
00514        const A7& a7, const A8& a8, const A9& a9,
00515        const A10& a10, const A11& a11) {
00516   return new C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
00517 }
00518 
00519 template<typename C, typename A1, typename A2, typename A3,
00520         typename A4, typename A5, typename A6,
00521         typename A7, typename A8, typename A9,
00522         typename A10, typename A11, typename A12> inline C*
00523 tm_new (const A1& a1, const A2& a2, const A3& a3,
00524        const A4& a4, const A5& a5, const A6& a6,
00525        const A7& a7, const A8& a8, const A9& a9,
00526        const A10& a10, const A11& a11, const A12& a12) {
00527   return new C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
00528 }
00529 
00530 template<typename C, typename A1, typename A2, typename A3,
00531         typename A4, typename A5, typename A6,
00532         typename A7, typename A8, typename A9,
00533         typename A10, typename A11, typename A12,
00534         typename A13> inline C*
00535 tm_new (const A1& a1, const A2& a2, const A3& a3,
00536        const A4& a4, const A5& a5, const A6& a6,
00537        const A7& a7, const A8& a8, const A9& a9,
00538        const A10& a10, const A11& a11, const A12& a12,
00539        const A13& a13) {
00540   return new C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
00541 }
00542 
00543 template<typename C, typename A1, typename A2, typename A3,
00544         typename A4, typename A5, typename A6,
00545         typename A7, typename A8, typename A9,
00546         typename A10, typename A11, typename A12,
00547         typename A13, typename A14> inline C*
00548 tm_new (const A1& a1, const A2& a2, const A3& a3,
00549        const A4& a4, const A5& a5, const A6& a6,
00550        const A7& a7, const A8& a8, const A9& a9,
00551        const A10& a10, const A11& a11, const A12& a12,
00552        const A13& a13, const A14& a14) {
00553   return new C (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
00554 }
00555 
00556 template<typename C, typename A1, typename A2, typename A3,
00557         typename A4, typename A5, typename A6,
00558         typename A7, typename A8, typename A9,
00559         typename A10, typename A11, typename A12,
00560         typename A13, typename A14, typename A15> inline C*
00561 tm_new (const A1& a1, const A2& a2, const A3& a3,
00562        const A4& a4, const A5& a5, const A6& a6,
00563        const A7& a7, const A8& a8, const A9& a9,
00564        const A10& a10, const A11& a11, const A12& a12,
00565        const A13& a13, const A14& a14, const A15& a15) {
00566   return new C (a1, a2, a3, a4, a5, a6, a7, a8, a9,
00567                 a10, a11, a12, a13, a14, a15);
00568 }
00569 
00570 template<typename C> inline void
00571 tm_delete (C* ptr) {
00572   delete ptr;
00573 }
00574 
00575 template<typename C> inline C*
00576 tm_new_array (int n) {
00577   return new C[n];
00578 }
00579 
00580 template<typename C> inline void
00581 tm_delete_array (C* Ptr) {
00582   delete[] Ptr;
00583 }
00584 
00585 #endif // defined(NO_FAST_ALLOC) || defined(X11TEXMACS)
00586 
00587 #endif // defined FAST_ALLOC_H