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.
Diff: linearArray.hpp
- Revision:
- 13:db9ebea23baf
- Parent:
- 12:e4f557b33732
--- a/linearArray.hpp Tue Mar 14 12:24:59 2017 +0000
+++ b/linearArray.hpp Fri Mar 17 10:54:09 2017 +0000
@@ -1,11 +1,14 @@
-
template<class type>
-LinearArray<type>::LinearArray(int size, bool forced) :
+LinearArray<type>::LinearArray(int size, char * name, bool forced) :
_elem_count(0), _array_size(size), _front(0), _rear(-1), _forced(forced) {
- linear_array_count++;
- linear_array_memeory_used += sizeof(type) * size;
+ linear_array_info[linear_array_count] = new char[20];
+ int sizeof_this = sizeof(type) * size;
+ snprintf(linear_array_info[linear_array_count], 20, "%s:%d\n", name, sizeof_this);
+
+ linear_array_count++;
+ linear_array_memeory_used += sizeof_this;
_array = new (std::nothrow) type[size];
}