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.
Revision 13:db9ebea23baf, committed 2017-03-17
- Comitter:
- UHSLMarcus
- Date:
- Fri Mar 17 10:54:09 2017 +0000
- Parent:
- 12:e4f557b33732
- Commit message:
- fixed some errors
Changed in this revision
| linearArray.h | Show annotated file Show diff for this revision Revisions of this file |
| linearArray.hpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/linearArray.h Tue Mar 14 12:24:59 2017 +0000
+++ b/linearArray.h Fri Mar 17 10:54:09 2017 +0000
@@ -8,7 +8,7 @@
template<class type>
class LinearArray {
public:
- LinearArray(int size, bool forced = false);
+ LinearArray(int size, char * name, bool forced = false);
~LinearArray();
int push(type item);
type& pop();
--- 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];
}