Commit 6ab0afea authored by qq_38816927's avatar qq_38816927

10层复杂对象优化

parent b6539f43
......@@ -10,4 +10,7 @@ actual fun pirntRandomHiLog() {
}
actual fun testArkTsToKotin() {
}
actual fun triggerANRByInfiniteLoop() {
}
\ No newline at end of file
......@@ -24,6 +24,7 @@ import com.dong.demo013.navigation.ComposeGroup
import com.dong.demo013.navigation.Page
import com.dong.maxhap.demos.FaultLogDemo
import com.dong.maxhap.demos.NativeFaultDemo
import kotlin.native.concurrent.ThreadLocal
@Composable
internal fun App() {
......@@ -110,7 +111,7 @@ internal fun HomeScreen(
}
Button(
onClick = {
// 无限递归 - 栈溢出
// 触发卡死
val testInfinite: Boolean = true;
fun infinite(): Int = infinite() + 1
infinite() // 触发 StackOverflowError
......@@ -349,4 +350,5 @@ internal fun DemoScreen(
}
}
}
}
\ No newline at end of file
}
......@@ -10,4 +10,8 @@ expect fun pirntSingleHiLog();
expect fun pirntRandomHiLog();
expect fun testArkTsToKotin();
\ No newline at end of file
expect fun testArkTsToKotin();
//稳定触发鸿蒙卡死
expect fun triggerANRByInfiniteLoop();
\ No newline at end of file
......@@ -11,4 +11,7 @@ actual fun pirntRandomHiLog() {
}
actual fun testArkTsToKotin() {
}
actual fun triggerANRByInfiniteLoop() {
}
\ No newline at end of file
......@@ -54,4 +54,10 @@ actual fun pirntRandomHiLog(){
@CName("testArkTsToKotin")
actual fun testArkTsToKotin() {
print("测试ArkTs至Kotlin单向跳转")
}
actual fun triggerANRByInfiniteLoop() {
while (true){
}
}
\ No newline at end of file
package com.dong.demo013
import kotlinx.cinterop.ExperimentalForeignApi
import platform.ohos.OH_LOG_Print
import platform.posix.usleep
import kotlin.experimental.ExperimentalNativeApi
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class, kotlin.experimental.ExperimentalNativeApi::class)
......@@ -53,4 +54,10 @@ actual fun pirntRandomHiLog(){
@CName("testArkTsToKotin")
actual fun testArkTsToKotin() {
print("测试ArkTs至Kotlin单向跳转")
}
actual fun triggerANRByInfiniteLoop() {
while (true){
}
}
\ No newline at end of file
......@@ -1138,6 +1138,7 @@ typedef struct {
void (*pirntRandomHiLog)();
void (*pirntSingleHiLog)();
void (*testArkTsToKotin_)();
void (*triggerANRByInfiniteLoop)();
} demo013;
} dong;
} com;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment