Browse Source

Merge branch 'master' of https://gitee.com/openLuat/luatos-soc-air101

Dozingfiretruck 4 years ago
parent
commit
dab371cec7
2 changed files with 21 additions and 0 deletions
  1. 1 0
      app/port/luat_fs_air101.c
  2. 20 0
      app/port/luat_malloc_air101.c

+ 1 - 0
app/port/luat_fs_air101.c

@@ -23,6 +23,7 @@ uint32_t luadb_size_kb;
 uint32_t lfs_addr;
 uint32_t lfs_size_kb;
 
+
 #ifndef FLASH_FS_REGION_SIZE
 #define FLASH_FS_REGION_SIZE 112
 #endif

+ 20 - 0
app/port/luat_malloc_air101.c

@@ -11,6 +11,14 @@
 #include "luat_log.h"
 #include "wm_mem.h"
 
+
+const uint32_t luat_rom_addr_start = 0x8010000;
+#ifdef AIR103
+const uint32_t luat_rom_addr_end   = 0x80FFFFF;
+#else
+const uint32_t luat_rom_addr_end   = 0x81FFFFF;
+#endif
+
 //------------------------------------------------
 //  管理系统内存
 
@@ -64,7 +72,19 @@ void* __attribute__((section (".ram_run"))) luat_heap_alloc(void *ud, void *ptr,
     	}
         return ptmp;
     }
+#if 0
+    uint32_t ptrv = (uint32_t)ptr;
+    if (ptrv != 0) {
+        if (ptrv >= luat_rom_addr_start && ptrv <= luat_rom_addr_end) {
+            // nop 无需释放
+        }
+        else {
+            brel(ptr);
+        }
+    }
+#else
     brel(ptr);
+#endif
     return NULL;
 }