Skip to content

Commit

Permalink
find armv8 string dtor
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed Dec 25, 2023
1 parent f8cc461 commit 00e2bfe
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions loader/src/platform/android/gdstdlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

static constexpr ptrdiff_t MENULAYER_SCENE = 0x309068 - 0x10000;
static constexpr ptrdiff_t STRING_EMPTY = 0xaa1c3c - 0x10000;
static constexpr ptrdiff_t OPERATOR_DELETE = 0x7514c8 - 0x10000 + 1;
static constexpr ptrdiff_t STRING_DTOR = 0x7514c8 - 0x10000 + 1;
static constexpr ptrdiff_t STRING_COPY = 0x753a44 - 0x10000 + 1;

#elif defined(GEODE_IS_ANDROID64)

static constexpr ptrdiff_t MENULAYER_SCENE = 0x6a62ec - 0x100000;
static constexpr ptrdiff_t STRING_EMPTY = 0x12d8568 - 0x100000;
static constexpr ptrdiff_t OPERATOR_DELETE = 0xd6cb80 - 0x100000;
static constexpr ptrdiff_t STRING_DTOR = 0xdb9778 - 0x100000; // it's inlined but it exists !!!!
static constexpr ptrdiff_t STRING_COPY = 0xdb5fdc - 0x100000;

#endif
Expand Down Expand Up @@ -44,11 +44,7 @@ namespace geode::stl {
void StringImpl::free() {
if (data.m_data == nullptr || data.m_data == emptyInternalString()) return;
// TODO: reimplement this
#ifdef GEODE_IS_ANDROID32
reinterpret_cast<void (*)(StringData*)>(geode::base::get() + OPERATOR_DELETE)(&data);
#else
reinterpret_cast<void (*)(void*)>(geode::base::get() + OPERATOR_DELETE)(&data.m_data[-1]);
#endif
reinterpret_cast<void (*)(StringData*)>(geode::base::get() + STRING_DTOR)(&data);
}

char* StringImpl::getStorage() {
Expand Down

0 comments on commit 00e2bfe

Please sign in to comment.