Zephyr: Track memory allocations

This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2024-12-02 10:04:23 +00:00
1 parent 9b0ec2dae0
commit 3457c2e2fd
4 files changed
+11 -4

No files matched your search

+7 -3
View File
@@ -3,7 +3,7 @@ ZEPHYR_PROJECT?=~/zephyrproject
all: coap-client
coap-client: client-src/src/main.c client-src/*
LIBCOAP_DIR=`pwd`/../.. ;\
@LIBCOAP_DIR=`pwd`/../.. ;\
(. $(ZEPHYR_PROJECT)/.venv/bin/activate ;\
cd $(ZEPHYR_PROJECT)/zephyr ;\
west build -p always -b native_sim \
@@ -12,5 +12,9 @@ coap-client: client-src/src/main.c client-src/*
-DEXTRA_ZEPHYR_MODULES=$${LIBCOAP_DIR} \
-DEXTRA_CONF_FILE=$${LIBCOAP_DIR}/zephyr/libcoap-mbedtls.conf \
--fresh ;\
deactivate) ;\
cp -f $(ZEPHYR_PROJECT)/zephyr/build/zephyr/zephyr.exe coap-client
deactivate)
@cp -f $(ZEPHYR_PROJECT)/zephyr/build/zephyr/zephyr.exe coap-client
clean:
@rm -rf $(ZEPHYR_PROJECT)/zephyr/build
@rm -f coap-client
+1 -1
View File
@@ -208,5 +208,5 @@ fail:
coap_free_context(coap_context);
coap_cleanup();
return 0;
exit(0);
}
+2
View File
@@ -84,6 +84,8 @@
#define mbedtls_realloc(a,b) realloc(a,b)
#define mbedtls_strdup(a) strdup(a)
#define mbedtls_strndup(a,b) strndup(a,b)
#undef mbedtls_free
#define mbedtls_free(a) free(a)
#ifndef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED
/* definition changed in later mbedtls code versions */
+1
View File
@@ -106,6 +106,7 @@ if(CONFIG_LIBCOAP)
add_subdirectory(.. build)
target_compile_definitions(coap-3 PUBLIC WITH_ZEPHYR)
target_compile_definitions(coap-3 PUBLIC COAP_MEMORY_TYPE_TRACK=1)
target_link_libraries(coap-3 PUBLIC zephyr_interface)
set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS coap-3)