Commits

Johannes Pfau  committed 072e16e

Add support for bionic/android to rt.memory

  • Participants
  • Parent commits 24e8402
  • Branches android-upstream2

Comments (0)

Files changed (1)

File d/druntime/rt/memory.d

     }
     version( linux )
     {
-        version = SimpleLibcStackEnd;
-
-        version( SimpleLibcStackEnd )
+        version(Android)
         {
-            extern (C) extern __gshared void* __libc_stack_end;
+            extern(C) void* __get_stack_base(int* p_stack_size);
+        }
+        else
+        {
+            version = SimpleLibcStackEnd;
+    
+            version( SimpleLibcStackEnd )
+            {
+                extern (C) extern __gshared void* __libc_stack_end;
+            }
         }
     }
     version( FreeBSD )
     }
     else version( linux )
     {
-        version( SimpleLibcStackEnd )
+        version(Android)
+        {
+            int stackSize;
+            return __get_stack_base(&stackSize);
+        }
+        else version( SimpleLibcStackEnd )
         {
             return __libc_stack_end;
         }