diff --git a/dtool/src/parser-inc/Sources.pp b/dtool/src/parser-inc/Sources.pp index 9b6b53b468..4df753a7df 100644 --- a/dtool/src/parser-inc/Sources.pp +++ b/dtool/src/parser-inc/Sources.pp @@ -1,4 +1,5 @@ #define INSTALL_PARSER_INC \ - algorithm deque iostream list map pair queue set stack stdtypedefs.h \ + algorithm deque iostream list map memory \ + pair queue set stack stdtypedefs.h \ string vector windows.h zlib.h md5.h files.h hex.h \ nurbs.hh diff --git a/dtool/src/parser-inc/memory b/dtool/src/parser-inc/memory new file mode 100644 index 0000000000..a28d8cea21 --- /dev/null +++ b/dtool/src/parser-inc/memory @@ -0,0 +1,52 @@ +// Filename: allocator +// Created by: drose (12May00) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved +// +// All use of this software is subject to the terms of the Panda 3d +// Software license. You should have received a copy of this license +// along with this source code; you will also find a current copy of +// the license at http://www.panda3d.org/license.txt . +// +// To contact the maintainers of this program write to +// panda3d@yahoogroups.com . +// +//////////////////////////////////////////////////////////////////// + +// This file, and all the other files in this directory, aren't +// intended to be compiled--they're just parsed by CPPParser (and +// interrogate) in lieu of the actual system headers, to generate the +// interrogate database. + +#ifndef ALLOCATOR_H +#define ALLOCATOR_H + +#include + +#ifdef GCC_STYLE_ALLOCATOR + +class alloc { +public: + static void *allocate(size_t n); + static void deallocate(void *p, size_t n); +}; + +#else // GCC_STYLE_ALLOCATOR + +template +class allocator { +public: + typedef Type *pointer; + typedef const Type *const_pointer; + typedef size_t size_type; + + INLINE pointer allocate(size_type n, allocator::const_pointer hint = 0); + INLINE void deallocate(pointer p, size_type n); +}; + +#endif // GCC_STYLE_ALLOCATOR + +#endif