Skip to content

Commit 734af8c

Browse files
committed
Rename ESP32 system_info/1 memory keys to match available STM32 keys
Renames ESP32 system_info/1 heap memory keys from esp32_free_heap_size to atomvm_free_heap_size and esp32_minimum_free_size to atomvm_minimum_free_size to match newly added STM32 memory keys. Signed-off-by: Winford <winford@object.stream>
1 parent 15a8481 commit 734af8c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5353
### Changed
5454

5555
- Removed `externalterm_to_term_copy` added in [0.6.5] and introduced flags to `externalterm_to_term` to perform copy.
56+
- Renamed ESP32 `system_info/1` memory keys from `esp32_free_heap_size` to `atomvm_free_heap_size` and
57+
`esp32_minimum_free_size` to `atomvm_minimum_free_size` to match newly added STM32 memory keys.
5658

5759
### Fixed
5860

src/platforms/esp32/components/avm_sys/sys.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ static void *select_thread_loop(void *);
7272
static void select_thread_signal(struct ESP32PlatformData *platform);
7373

7474
// clang-format off
75-
static const char *const esp_free_heap_size_atom = "\x14" "esp32_free_heap_size";
75+
static const char *const atomvm_free_heap_size_atom = "\x15" "atomvm_free_heap_size";
7676
static const char *const esp_largest_free_block_atom = "\x18" "esp32_largest_free_block";
77-
static const char *const esp_get_minimum_free_size_atom = "\x17" "esp32_minimum_free_size";
77+
static const char *const atomvm_get_minimum_free_size_atom = "\x18" "atomvm_minimum_free_size";
7878
static const char *const esp_chip_info_atom = "\xF" "esp32_chip_info";
7979
static const char *const esp_idf_version_atom = "\xF" "esp_idf_version";
8080
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 2)
@@ -499,13 +499,13 @@ static term get_features(Context *ctx, uint32_t features)
499499
term sys_get_info(Context *ctx, term key)
500500
{
501501
GlobalContext *glb = ctx->global;
502-
if (key == globalcontext_make_atom(glb, esp_free_heap_size_atom)) {
502+
if (key == globalcontext_make_atom(glb, atomvm_free_heap_size_atom)) {
503503
return term_from_int32(esp_get_free_heap_size());
504504
}
505505
if (key == globalcontext_make_atom(glb, esp_largest_free_block_atom)) {
506506
return term_from_int32(heap_caps_get_largest_free_block(MALLOC_CAP_DEFAULT));
507507
}
508-
if (key == globalcontext_make_atom(glb, esp_get_minimum_free_size_atom)) {
508+
if (key == globalcontext_make_atom(glb, atomvm_get_minimum_free_size_atom)) {
509509
return term_from_int32(esp_get_minimum_free_heap_size());
510510
}
511511
if (key == globalcontext_make_atom(glb, esp_chip_info_atom)) {

0 commit comments

Comments
 (0)