mirror of
https://github.com/zeldaret/st
synced 2026-06-29 03:10:53 -04:00
b116e79e9f
* UnkStruct_027e09b8_001 OK * match func_ov001_020b7830 * fix build issues * UnkStruct_027e0cd8_001 49% * UnkStruct_027e0cd8_001 OK * fix build issues * UnkStruct_027e0cd8_0C_001 92% * port some MSL C++ headers from rb3 and key decomps * fix build issues * UnkStruct_027e0cd8_0C_001 98%
52 lines
1.2 KiB
Plaintext
52 lines
1.2 KiB
Plaintext
#ifndef _STD_MEMORY
|
|
#define _STD_MEMORY
|
|
|
|
#include <new>
|
|
#include <limits>
|
|
|
|
// from rb3 decomp
|
|
|
|
namespace std {
|
|
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;
|
|
|
|
template <class U> struct rebind {
|
|
typedef allocator<U> other;
|
|
};
|
|
|
|
allocator() {}
|
|
allocator(const allocator<T> &) {}
|
|
template <class U> allocator(const allocator<U> &) {}
|
|
~allocator() {}
|
|
|
|
size_type max_size() const throw() {
|
|
return std::numeric_limits<size_t>::max() / sizeof(T);
|
|
}
|
|
|
|
pointer allocate(size_type count, const void *hint = 0) {
|
|
return reinterpret_cast<pointer>(::operator new(count * sizeof(T), 1, 4));
|
|
}
|
|
|
|
void deallocate(pointer p, size_type n) {
|
|
::operator delete(p);
|
|
}
|
|
|
|
void construct(pointer p, const_reference val) {
|
|
new(p) T(val);
|
|
}
|
|
|
|
void destroy(pointer p) {
|
|
p->~T();
|
|
}
|
|
};
|
|
}; // namespace std
|
|
|
|
#endif // _STD_MEMORY
|