diff options
author | kan <kan@FreeBSD.org> | 2004-08-12 16:41:42 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2004-08-12 16:41:42 +0000 |
commit | d42790ccc00a70f00d10a3b8f17967a5b396bd4d (patch) | |
tree | 05895ca3fdba11097afd624bf6f64962995c416e /contrib/libstdc++/stl/defalloc.h | |
parent | d42b9316c71d1b89b1b05d36be366eadf7bd8cdf (diff) | |
download | FreeBSD-src-d42790ccc00a70f00d10a3b8f17967a5b396bd4d.zip FreeBSD-src-d42790ccc00a70f00d10a3b8f17967a5b396bd4d.tar.gz |
Remove files that are not part of GCC 3.4.x from the vendor branch.
Diffstat (limited to 'contrib/libstdc++/stl/defalloc.h')
-rw-r--r-- | contrib/libstdc++/stl/defalloc.h | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/contrib/libstdc++/stl/defalloc.h b/contrib/libstdc++/stl/defalloc.h deleted file mode 100644 index 0bfcc2c..0000000 --- a/contrib/libstdc++/stl/defalloc.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * - * Copyright (c) 1994 - * Hewlett-Packard Company - * - * Permission to use, copy, modify, distribute and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and - * that both that copyright notice and this permission notice appear - * in supporting documentation. Hewlett-Packard Company makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - */ - -// Inclusion of this file is DEPRECATED. This is the original HP -// default allocator. It is provided only for backward compatibility. -// This file WILL BE REMOVED in a future release. -// -// DO NOT USE THIS FILE unless you have an old container implementation -// that requires an allocator with the HP-style interface. -// -// Standard-conforming allocators have a very different interface. The -// standard default allocator is declared in the header <memory>. - -#ifndef DEFALLOC_H -#define DEFALLOC_H - -#include <new.h> -#include <stddef.h> -#include <stdlib.h> -#include <limits.h> -#include <iostream.h> -#include <algobase.h> - - -template <class T> -inline T* allocate(ptrdiff_t size, T*) { - set_new_handler(0); - T* tmp = (T*)(::operator new((size_t)(size * sizeof(T)))); - if (tmp == 0) { - cerr << "out of memory" << endl; - exit(1); - } - return tmp; -} - - -template <class T> -inline void deallocate(T* buffer) { - ::operator delete(buffer); -} - -template <class T> -class allocator { -public: - typedef T value_type; - typedef T* pointer; - typedef const T* const_pointer; - typedef T& reference; - typedef const T& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - pointer allocate(size_type n) { - return ::allocate((difference_type)n, (pointer)0); - } - void deallocate(pointer p) { ::deallocate(p); } - pointer address(reference x) { return (pointer)&x; } - const_pointer const_address(const_reference x) { - return (const_pointer)&x; - } - size_type init_page_size() { - return max(size_type(1), size_type(4096/sizeof(T))); - } - size_type max_size() const { - return max(size_type(1), size_type(UINT_MAX/sizeof(T))); - } -}; - -class allocator<void> { -public: - typedef void* pointer; -}; - - - -#endif |