Skip to content

feat(memory): add c++ global allocate functions #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025

Conversation

Lzw655
Copy link
Collaborator

@Lzw655 Lzw655 commented Apr 29, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings April 29, 2025 08:29
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces C++ global memory allocation support while refactoring and modularizing the existing memory allocation code. Key changes include:

  • Removal of legacy C/C++ general allocation functions from esp_utils_mem.c.
  • Addition of dedicated header files for standard, MicroPython, and ESP-specific memory allocation macros.
  • Extended configuration and version updates (including global C++ allocation settings) and adjustments to workflow file checkouts.

Reviewed Changes

Copilot reviewed 27 out of 31 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/memory/esp_utils_mem.c Removed legacy allocation functions, preserving minimal info printing.
src/memory/allocation/esp_utils_mem_std.h Added stdlib allocation macros.
src/memory/allocation/esp_utils_mem_mpy.h Added MicroPython allocation macros.
src/memory/allocation/esp_utils_mem_esp.h Added ESP-specific allocation macros based on heap_caps.
src/log/esp_utils_log.h Streamlined logging macros and external function declarations.
src/esp_utils_versions.h Updated version definitions.
src/esp_utils_types.h Introduced new memory caps macros.
src/esp_utils_conf_kconfig.h & esp_utils_conf.h Updated configuration error handling and new global allocation configs.
.github/workflows/* Updated checkout actions and tool versions.
CHANGELOG.md Documented new C++ global memory allocation feature.
Files not reviewed (4)
  • CMakeLists.txt: Language not supported
  • Kconfig: Language not supported
  • library.properties: Language not supported
  • micropython.cmake: Language not supported
Comments suppressed due to low confidence (1)

esp_utils_conf.h:79

  • Consider replacing the hardcoded alignment value '1' with a configuration constant (e.g. ESP_UTILS_CONF_MEM_GEN_ALLOC_ESP_ALIGN) to ensure consistency with other allocation settings.
#define ESP_UTILS_CONF_MEM_GEN_ALLOC_CUSTOM_MALLOC(x)    heap_caps_aligned_alloc(1, x, MALLOC_CAP_DEFAULT | MALLOC_CAP_8BIT)

@Lzw655 Lzw655 force-pushed the feat/add_memory_cxx_global_alloc branch from 0cb6443 to fb86a82 Compare April 29, 2025 08:34
@Lzw655 Lzw655 force-pushed the feat/add_memory_cxx_global_alloc branch from fb86a82 to 55e90d3 Compare April 29, 2025 08:37
@Lzw655 Lzw655 merged commit b68e772 into master Apr 29, 2025
9 checks passed
@Lzw655 Lzw655 deleted the feat/add_memory_cxx_global_alloc branch April 29, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant