mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
add unknown_allocator
This commit is contained in:
parent
4fd01828cf
commit
8aefcb0452
@ -18,11 +18,10 @@
|
||||
|
||||
#ifndef DALLOCATOR_H
|
||||
#define DALLOCATOR_H
|
||||
#include <memory>
|
||||
|
||||
#include "dtoolbase.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : dallocator
|
||||
// Description : This is similar to pallocator, but always uses the
|
||||
@ -36,7 +35,9 @@
|
||||
// within the MemoryUsage class itself.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(OLD_STYLE_ALLOCATOR)
|
||||
#if defined(UNKNOWN_ALLOCATOR)
|
||||
#define dallocator allocator
|
||||
#elif defined(OLD_STYLE_ALLOCATOR)
|
||||
// Early versions of gcc wanted to use its own kind of allocator,
|
||||
// somewhat different from the STL standard. Irix uses this one too.
|
||||
// It might be inherited from an early draft of the STL standard.
|
||||
@ -80,13 +81,14 @@ class dallocator : public allocator<Type> {
|
||||
public:
|
||||
#ifndef NDEBUG
|
||||
INLINE pointer allocate(size_type n, allocator<void>::const_pointer hint = 0);
|
||||
// INLINE void deallocate(pointer p, size_type n);
|
||||
INLINE void deallocate(void *p, size_type n);
|
||||
#endif // NDEBUG
|
||||
};
|
||||
#endif // *_STYLE_ALLOCATOR
|
||||
|
||||
#if !defined(UNKNOWN_ALLOCATOR)
|
||||
#include "dallocator.T"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -48,6 +48,14 @@
|
||||
/* C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data */
|
||||
#pragma warning (disable : 4244)
|
||||
|
||||
/*
|
||||
#if _MSC_VER < 1300
|
||||
#pragma message("VC 6.0")
|
||||
#else
|
||||
#pragma message("VC 7.0")
|
||||
#endif
|
||||
*/
|
||||
|
||||
#endif /* WIN32_VC */
|
||||
|
||||
#include "dtoolsymbols.h"
|
||||
|
@ -19,9 +19,9 @@
|
||||
#ifndef PALLOCATOR_H
|
||||
#define PALLOCATOR_H
|
||||
|
||||
#include <memory>
|
||||
#include "dtoolbase.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : pallocator
|
||||
@ -34,7 +34,10 @@
|
||||
// to use a pallocator.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(OLD_STYLE_ALLOCATOR)
|
||||
#if defined(UNKNOWN_ALLOCATOR)
|
||||
#define pallocator allocator
|
||||
|
||||
#elif defined(OLD_STYLE_ALLOCATOR)
|
||||
// Early versions of gcc wanted to use its own kind of allocator,
|
||||
// somewhat different from the STL standard. Irix uses this one too.
|
||||
// It might be inherited from an early draft of the STL standard.
|
||||
@ -78,13 +81,14 @@ class pallocator : public allocator<Type> {
|
||||
public:
|
||||
#ifndef NDEBUG
|
||||
INLINE pointer allocate(size_type n, allocator<void>::const_pointer hint = 0);
|
||||
// INLINE void deallocate(pointer p, size_type n);
|
||||
INLINE void deallocate(void *p, size_type n);
|
||||
#endif // NDEBUG
|
||||
};
|
||||
#endif // *_STYLE_ALLOCATOR
|
||||
|
||||
#if !defined(UNKNOWN_ALLOCATOR)
|
||||
#include "pallocator.T"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -21,9 +21,13 @@
|
||||
|
||||
#include "dtoolbase.h"
|
||||
#include "pallocator.h"
|
||||
|
||||
#include <deque>
|
||||
|
||||
#ifdef UNKNOWN_ALLOCATOR
|
||||
#define pdeque deque
|
||||
|
||||
#else
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : pdeque
|
||||
// Description : This is our own Panda specialization on the default
|
||||
@ -41,4 +45,4 @@ public:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -21,9 +21,13 @@
|
||||
|
||||
#include "dtoolbase.h"
|
||||
#include "pallocator.h"
|
||||
|
||||
#include <list>
|
||||
|
||||
#ifdef UNKNOWN_ALLOCATOR
|
||||
#define plist list
|
||||
|
||||
#else
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : plist
|
||||
// Description : This is our own Panda specialization on the default
|
||||
@ -47,4 +51,4 @@ public:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -24,6 +24,11 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#ifdef UNKNOWN_ALLOCATOR
|
||||
#define pmap map
|
||||
#define pmultimap multimap
|
||||
#else
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : pmap
|
||||
// Description : This is our own Panda specialization on the default
|
||||
@ -55,4 +60,4 @@ public:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -24,6 +24,11 @@
|
||||
|
||||
#include <set>
|
||||
|
||||
#ifdef UNKNOWN_ALLOCATOR
|
||||
#define pset set
|
||||
#define pmultiset multiset
|
||||
#else
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : pset
|
||||
// Description : This is our own Panda specialization on the default
|
||||
@ -55,4 +60,4 @@ public:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -19,10 +19,14 @@
|
||||
#ifndef PVECTOR_H
|
||||
#define PVECTOR_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "dtoolbase.h"
|
||||
#include "pallocator.h"
|
||||
|
||||
#include <vector>
|
||||
#ifdef UNKNOWN_ALLOCATOR
|
||||
#define pvector vector
|
||||
#else
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : pvector
|
||||
@ -42,4 +46,5 @@ public:
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user