Browse Source

porting bugs

David Rose 24 years ago
parent
commit
f4c58e7c2b
3 changed files with 13 additions and 11 deletions
  1. 3 2
      dtool/src/dtoolbase/pallocator.T
  2. 2 1
      dtool/src/dtoolbase/pallocator.h
  3. 8 8
      dtool/src/dtoolbase/pmap.h

+ 3 - 2
dtool/src/dtoolbase/pallocator.T

@@ -43,8 +43,9 @@ allocate(pallocator<Type>::size_type n, allocator<void>::const_pointer) {
 
 template<class Type>
 INLINE void pallocator<Type>::
-deallocate(pallocator<Type>::pointer p, allocator<Type>::size_type) {
-  (*global_operator_delete)(p);
+//deallocate(pallocator<Type>::pointer p, allocator<Type>::size_type) {
+deallocate(void *p, allocator<Type>::size_type) {
+  (*global_operator_delete)((void *)p);
 }
 #endif  // NDEBUG
 

+ 2 - 1
dtool/src/dtoolbase/pallocator.h

@@ -55,7 +55,8 @@ 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(pointer p, size_type n);
+  INLINE void deallocate(void *p, size_type n);
 #endif  // NDEBUG
 };
 #endif  // GCC_STYLE_ALLOCATOR

+ 8 - 8
dtool/src/dtoolbase/pmap.h

@@ -32,11 +32,11 @@
 //               memory.
 ////////////////////////////////////////////////////////////////////
 template<class Key, class Value, class Compare = less<Key> >
-class pmap : public map<Key, Value, Compare, pallocator<pair<Key, Value> > > {
+class pmap : public map<Key, Value, Compare, pallocator<Value> > {
 public:
-  pmap() : map<Key, Value, Compare, pallocator<pair<Key, Value> > >() { }
-  pmap(const pmap<Key, Value, Compare> &copy) : map<Key, Value, Compare, pallocator<pair<Key, Value> > >(copy) { }
-  pmap(const Compare &comp) : map<Key, Compare, pallocator<Key> >(comp) { }
+  pmap() : map<Key, Value, Compare, pallocator<Value> >() { }
+  pmap(const pmap<Key, Value, Compare> &copy) : map<Key, Value, Compare, pallocator<Value> >(copy) { }
+  pmap(const Compare &comp) : map<Key, Value, Compare, pallocator<Value> >(comp) { }
 };
 
 ////////////////////////////////////////////////////////////////////
@@ -47,11 +47,11 @@ public:
 //               memory.
 ////////////////////////////////////////////////////////////////////
 template<class Key, class Value, class Compare = less<Key> >
-class pmultimap : public multimap<Key, Value, Compare, pallocator<pair<Key, Value> > > {
+class pmultimap : public multimap<Key, Value, Compare, pallocator<Value> > {
 public:
-  pmultimap() : multimap<Key, Value, Compare, pallocator<pair<Key, Value> > >() { }
-  pmultimap(const pmultimap<Key, Value, Compare> &copy) : multimap<Key, Value, Compare, pallocator<pair<Key, Value> > >(copy) { }
-  pmultimap(const Compare &comp) : multimap<Key, Compare, pallocator<Key> >(comp) { }
+  pmultimap() : multimap<Key, Value, Compare, pallocator<Value> >() { }
+  pmultimap(const pmultimap<Key, Value, Compare> &copy) : multimap<Key, Value, Compare, pallocator<Value> >(copy) { }
+  pmultimap(const Compare &comp) : multimap<Key, Value, Compare, pallocator<Value> >(comp) { }
 };
 
 #endif