Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of http-example by
Diff: source/main-https-socket-reuse.cpp
- Revision:
- 17:97b1dd566b07
- Parent:
- 16:1374b4c35897
- Child:
- 20:d851bc648f9e
--- a/source/main-https-socket-reuse.cpp Mon Sep 04 16:32:38 2017 +0100 +++ b/source/main-https-socket-reuse.cpp Mon Sep 04 17:01:11 2017 +0100 @@ -60,7 +60,7 @@ mbed_stats_heap_t heap_stats; mbed_stats_heap_get(&heap_stats); - printf("[1] Heap: %lu / %lu\n", heap_stats.current_size, heap_stats.reserved_size); + printf("[1] Heap: %lu / %lu, max=%lu\n", heap_stats.current_size, heap_stats.reserved_size, heap_stats.max_size); NetworkInterface* network = easy_connect(true); if (!network) { @@ -68,7 +68,7 @@ } mbed_stats_heap_get(&heap_stats); - printf("[2] Heap: %lu / %lu\n", heap_stats.current_size, heap_stats.reserved_size); + printf("[2] Heap: %lu / %lu, max=%lu\n", heap_stats.current_size, heap_stats.reserved_size, heap_stats.max_size); // Create a TLS socket (which holds a TCPSocket) printf("\n----- Setting up TLS connection -----\n"); @@ -81,7 +81,7 @@ } mbed_stats_heap_get(&heap_stats); - printf("[3] Heap: %lu / %lu\n", heap_stats.current_size, heap_stats.reserved_size); + printf("[3] Heap: %lu / %lu, max=%lu\n", heap_stats.current_size, heap_stats.reserved_size, heap_stats.max_size); // GET request to httpbin.org { @@ -97,13 +97,13 @@ dump_response(get_res); mbed_stats_heap_get(&heap_stats); - printf("[4a] Heap: %lu / %lu\n", heap_stats.current_size, heap_stats.reserved_size); + printf("[4a] Heap: %lu / %lu, max=%lu\n", heap_stats.current_size, heap_stats.reserved_size, heap_stats.max_size); delete get_req; } mbed_stats_heap_get(&heap_stats); - printf("[4] Heap: %lu / %lu\n", heap_stats.current_size, heap_stats.reserved_size); + printf("[4b] Heap: %lu / %lu, max=%lu\n", heap_stats.current_size, heap_stats.reserved_size, heap_stats.max_size); // POST request to httpbin.org { @@ -126,12 +126,12 @@ } mbed_stats_heap_get(&heap_stats); - printf("[5] Heap: %lu / %lu\n", heap_stats.current_size, heap_stats.reserved_size); + printf("[5] Heap: %lu / %lu, max=%lu\n", heap_stats.current_size, heap_stats.reserved_size, heap_stats.max_size); delete socket; mbed_stats_heap_get(&heap_stats); - printf("[6] Heap: %lu / %lu\n", heap_stats.current_size, heap_stats.reserved_size); + printf("[6] Heap: %lu / %lu, max=%lu\n", heap_stats.current_size, heap_stats.reserved_size, heap_stats.max_size); Thread::wait(osWaitForever); }