diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-05-30 17:33:20 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-05-30 17:33:20 +0300 |
| commit | b525fbcad1ac8c7126caa82ec8458ffbb6284384 (patch) | |
| tree | 61abe4c1610fc2e0b6af8e5f926d5624692df2fe /Software/Embedded_SW/Embedded/Common/Utilities | |
| parent | 405096b3d489f4ea7b50b1d5db7d32241251b8d7 (diff) | |
| download | Tango-b525fbcad1ac8c7126caa82ec8458ffbb6284384.tar.gz Tango-b525fbcad1ac8c7126caa82ec8458ffbb6284384.zip | |
Version 1.4.0.4: Improved memory handling, handles SW crash after a job failure
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common/Utilities')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Common/Utilities/Utils.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c b/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c index 341a43704..3871acb94 100644 --- a/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c +++ b/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c @@ -15,12 +15,12 @@ //***************************************************************************** -#define MAX_MEM_LOG 100 +/*#define MAX_MEM_LOG 100 int freeIndex=0,malloc_index=0; uint32_t malloc_size[MAX_MEM_LOG+1]; uint32_t malloc_time[MAX_MEM_LOG+1]; void * malloc_addr[MAX_MEM_LOG+1]; -void * free_addr[MAX_MEM_LOG+1]; +void * free_addr[MAX_MEM_LOG+1];*/ //uint32_t total_allocated = 0; void *my_malloc(size_t _size) { @@ -43,14 +43,14 @@ void *my_malloc(size_t _size) malloc_time[malloc_index] = msec_millisecondCounter; } */ - if ((addr)&&(_size>400)) + /*if ((addr)&&(_size>400)) { malloc_addr[malloc_index] = addr; malloc_size[malloc_index] = _size; malloc_time[malloc_index] = msec_millisecondCounter; if (malloc_index++>=MAX_MEM_LOG) malloc_index = 0; - } + }*/ return addr; } int allocated_size = 0; @@ -80,9 +80,9 @@ void my_free(void *_ptr) // allocated_size+=malloc_size[i]; * */ - free_addr[freeIndex] = _ptr; - if (freeIndex++>=MAX_MEM_LOG) - freeIndex = 0; +// free_addr[freeIndex] = _ptr; +// if (freeIndex++>=MAX_MEM_LOG) +// freeIndex = 0; } } |
