Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0c2f5e1

Browse files
fix: fix memory leak in promise impl
1 parent07f2aeb commit0c2f5e1

File tree

6 files changed

+549
-513
lines changed

6 files changed

+549
-513
lines changed

‎components/esp32-javascript/esp32-javascript.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,8 @@ static duk_ret_t el_ledcWrite(duk_context *ctx)
532532

533533
staticduk_ret_tinfo(duk_context*ctx)
534534
{
535-
size_tinternal=heap_caps_get_free_size(MALLOC_CAP_INTERNAL);
536-
size_texternal=heap_caps_get_free_size(MALLOC_CAP_SPIRAM);
535+
size_tinternal=heap_caps_get_free_size(MALLOC_CAP_8BIT |MALLOC_CAP_INTERNAL);
536+
size_texternal=heap_caps_get_free_size(MALLOC_CAP_8BIT |MALLOC_CAP_SPIRAM);
537537

538538
jslog(INFO,"INTERNAL MEMORY HEAP INFO FREE: %d",internal);
539539
jslog(INFO,"EXTERNAL MEMORY HEAP INFO FREE: %d",external);
@@ -631,7 +631,7 @@ IRAM_ATTR void *duk_spiram_malloc(void *udata, size_t size)
631631
{
632632
if (spiramAvailable)
633633
{
634-
returnheap_caps_malloc(size,MALLOC_CAP_SPIRAM);
634+
returnheap_caps_malloc(size,MALLOC_CAP_8BIT |MALLOC_CAP_SPIRAM);
635635
}
636636
else
637637
{
@@ -647,7 +647,7 @@ IRAM_ATTR void *duk_spiram_realloc(void *udata, void *ptr, size_t size)
647647
{
648648
if (spiramAvailable)
649649
{
650-
returnheap_caps_realloc(ptr,size,MALLOC_CAP_SPIRAM);
650+
returnheap_caps_realloc(ptr,size,MALLOC_CAP_8BIT |MALLOC_CAP_SPIRAM);
651651
}
652652
else
653653
{
@@ -677,7 +677,7 @@ IRAM_ATTR void spiram_free(void *ptr)
677677

678678
boolspiramAvail()
679679
{
680-
void*ptr=heap_caps_malloc(1,MALLOC_CAP_SPIRAM);
680+
void*ptr=heap_caps_malloc(1,MALLOC_CAP_8BIT |MALLOC_CAP_SPIRAM);
681681
if (ptr!=NULL)
682682
{
683683
heap_caps_free(ptr);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp