diff options
Diffstat (limited to 'libstdc++/src')
-rw-r--r-- | libstdc++/src/new.cpp | 65 | ||||
-rw-r--r-- | libstdc++/src/one_time_construction.cpp | 50 | ||||
-rw-r--r-- | libstdc++/src/pure_virtual.cpp | 10 | ||||
-rw-r--r-- | libstdc++/src/typeinfo.cpp | 32 |
4 files changed, 0 insertions, 157 deletions
diff --git a/libstdc++/src/new.cpp b/libstdc++/src/new.cpp deleted file mode 100644 index 8189159..0000000 --- a/libstdc++/src/new.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "new" -#include <stdlib.h> - -const std::nothrow_t std::nothrow = {}; - -void* operator new(std::size_t size) -{ - void* p = malloc(size); - if (p == NULL) { - // abort(); - } - return p; -} - -void* operator new[](std::size_t size) -{ - void* p = malloc(size); - if (p == NULL) { - // abort(); - } - return p; -} - -void operator delete(void* ptr) -{ - if (ptr) { - free(ptr); - } -} - -void operator delete[](void* ptr) -{ - if (ptr) { - free(ptr); - } -} - -void* operator new(std::size_t size, const std::nothrow_t&) -{ - return malloc(size); -} - -void* operator new[](std::size_t size, const std::nothrow_t&) -{ - return malloc(size); -} - -void operator delete(void* ptr, const std::nothrow_t&) -{ - if (ptr) { - free(ptr); - } -} - -void operator delete[](void* ptr, const std::nothrow_t&) -{ - if (ptr) { - free(ptr); - } -} - - - - - diff --git a/libstdc++/src/one_time_construction.cpp b/libstdc++/src/one_time_construction.cpp deleted file mode 100644 index 304afb8..0000000 --- a/libstdc++/src/one_time_construction.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * one_time_construction.cpp - * - * Copyright 2006 The Android Open Source Project - * - * This file contains C++ ABI support functions for one time - * constructors as defined in the "Run-time ABI for the ARM Architecture" - * section 4.4.2 - */ - -#include <stddef.h> -#include <sys/atomics.h> - -extern "C" int __futex_wait(volatile void *ftx, int val, const struct timespec *timeout); -extern "C" int __futex_wake(volatile void *ftx, int count); - - -extern "C" int __cxa_guard_acquire(int volatile * gv) -{ - // 0 -> 2, return 1 - // 2 -> 6, wait and return 0 - // 6 untouched, wait and return 0 - // 1 untouched, return 0 -retry: - if (__atomic_cmpxchg(0, 0x2, gv) == 0) - return 1; - - __atomic_cmpxchg(0x2, 0x6, gv); // Indicate there is a waiter - __futex_wait(gv, 0x6, NULL); - if(*gv != 1) // __cxa_guard_abort was called, let every thread try since there is no return code for this condition - goto retry; - return 0; -} - -extern "C" void __cxa_guard_release(int volatile * gv) -{ - // 2 -> 1 - // 6 -> 1, and wake - if (__atomic_cmpxchg(0x2, 0x1, gv) == 0) - return; - - *gv = 0x1; - __futex_wake(gv, 0x7fffffff); -} - -extern "C" void __cxa_guard_abort(int volatile * gv) -{ - *gv = 0; - __futex_wake(gv, 0x7fffffff); -} diff --git a/libstdc++/src/pure_virtual.cpp b/libstdc++/src/pure_virtual.cpp deleted file mode 100644 index 663c1e9..0000000 --- a/libstdc++/src/pure_virtual.cpp +++ /dev/null @@ -1,10 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> - -extern "C" void __cxa_pure_virtual() -{ - fprintf(stderr, "Pure virtual function called. Are you calling virtual methods from a destructor?\n"); - abort(); -} - diff --git a/libstdc++/src/typeinfo.cpp b/libstdc++/src/typeinfo.cpp deleted file mode 100644 index b426f1a..0000000 --- a/libstdc++/src/typeinfo.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "typeinfo" -#include <stdlib.h> - -type_info::type_info() { -} - -type_info::~type_info() { -} - -char const * -type_info::name() const { - return "N/A"; -} - -bool -type_info::operator==(type_info const & right) const { - return false; -} - -bool -type_info::operator!=(type_info const & right) const { - return false; -} - -bool -type_info::before(type_info const & right) const { - return false; -} - -type_info::type_info(type_info const & right) { -} - |