fix(launcher): 图标区空白——menu_draw_icon 垫块+首字母先画、图片叠加(icon透明/解码失败时占位仍可见); 补 sys_mem_available_kb 实现(解锁OOM护栏编译) (agent-218)
launcher 333d6f53→9902f19c; 宿主test_host_icon PASS
This commit is contained in:
1 parent
228e9e79e0
commit
e8deed88bd
7 files changed
+193
-2
No files matched your search
@@ -12,6 +12,22 @@ char log_dir[256] = ""; /* "MeowOS/logs" on card, or "" */
|
||||
char log_file[256] = ""; /* full path of the boot log file */
|
||||
|
||||
|
||||
/* M2.85 内存护栏:读 /proc/meminfo 的 MemAvailable(kB)。失败返回 -1。
|
||||
* 供 launcher 在低内存时对大字库请求降档(OOM 防线)。 */
|
||||
long sys_mem_available_kb(void)
|
||||
{
|
||||
FILE *f = fopen("/proc/meminfo", "r");
|
||||
if (!f) return -1;
|
||||
char line[256];
|
||||
long kb = -1;
|
||||
while (fgets(line, sizeof line, f)) {
|
||||
if (sscanf(line, "MemAvailable: %ld kB", &kb) == 1) break;
|
||||
}
|
||||
fclose(f);
|
||||
return kb;
|
||||
}
|
||||
|
||||
|
||||
static int card_available(void)
|
||||
{
|
||||
/* TF card mounted? */
|
||||
|
||||
Reference in new issue
Block a user