aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Common
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-11-13 10:46:15 +0200
committerShlomo Hecht <shlomo@twine-s.com>2018-11-13 10:46:15 +0200
commit00525cc261ec117e2eb78ac2a4525fa3da92d399 (patch)
tree9f4c311d915b0305f31925bab4d87a97cf82d790 /Software/Embedded_SW/Embedded/Common
parent8d4920307ed4bbb6760245728934b91e249fe6c4 (diff)
parent996422d12e0a40aa408757989232f0225dc29a28 (diff)
downloadTango-00525cc261ec117e2eb78ac2a4525fa3da92d399.tar.gz
Tango-00525cc261ec117e2eb78ac2a4525fa3da92d399.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common')
-rw-r--r--Software/Embedded_SW/Embedded/Common/Utilities/Utils.c36
-rw-r--r--Software/Embedded_SW/Embedded/Common/report/distributor.c2
2 files changed, 25 insertions, 13 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c b/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c
index c745436ad..d339ab66b 100644
--- a/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c
+++ b/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c
@@ -16,18 +16,23 @@ static const float speedCoef = 5.3051647697298445256294587790838f;//(200 micro s
//*****************************************************************************
-#define MAX_MEM_LOG 200
-int freeIndex=0,malloc_index=0;
+#define MAX_MEM_LOG 300
+int free_index=0,malloc_index=0;
+int zero_mallocs=0,null_free=0;
uint32_t malloc_size[MAX_MEM_LOG];
uint32_t malloc_time[MAX_MEM_LOG];
void * malloc_addr[MAX_MEM_LOG];
-//void * free_addr[MAX_MEM_LOG];
+void * free_addr[MAX_MEM_LOG];
//uint32_t total_allocated = 0;
void *my_malloc(size_t _size)
{
void * addr = malloc (_size);
- if (_size == 0) return addr;
- int i;
+ if (_size == 0)
+ {
+ zero_mallocs++;
+ return addr;
+ }
+ /*int i;
for (i=0; i< MAX_MEM_LOG;i++)
{
if (malloc_time[i] == 0)
@@ -42,12 +47,12 @@ void *my_malloc(size_t _size)
malloc_addr[malloc_index] = addr;
malloc_size[malloc_index] = _size;
malloc_time[malloc_index] = msec_millisecondCounter;
- }
- //malloc_addr[malloc_index] = addr;
- //malloc_size[malloc_index] = _size;
- //malloc_time[malloc_index] = HibernateRTCSSGet();
- //if (malloc_index++>=MAX_MEM_LOG)
- // malloc_index = 0;
+ }*/
+ 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;
@@ -57,7 +62,7 @@ void my_free(void *_ptr)
free(_ptr);
if (_ptr)
{
- for (i=0; i< MAX_MEM_LOG;i++)
+/* for (i=0; i< MAX_MEM_LOG;i++)
{
if ( malloc_addr[i] == _ptr)
{
@@ -75,7 +80,14 @@ void my_free(void *_ptr)
allocated_size = 0;
// for (i=0; i< MAX_MEM_LOG;i++)
// allocated_size+=malloc_size[i];
+*/
+ free_addr[free_index] = _ptr;
+ if (free_index++>=MAX_MEM_LOG)
+ free_index = 0;
+
}
+ else
+ null_free++;
}
//*****************************************************************************
diff --git a/Software/Embedded_SW/Embedded/Common/report/distributor.c b/Software/Embedded_SW/Embedded/Common/report/distributor.c
index 46a3affd6..cbc754a7e 100644
--- a/Software/Embedded_SW/Embedded/Common/report/distributor.c
+++ b/Software/Embedded_SW/Embedded/Common/report/distributor.c
@@ -240,7 +240,7 @@ Void reportService(UArg arg0, UArg arg1)
int DistTableEntry;//,msgLen, errCode, par1, par2;
ReportInitParams InitParams;
- InitParams.DistributorQueueMaxMsgs = 20;
+ InitParams.DistributorQueueMaxMsgs = 15;
InitParams.DistributorTaskPriority = 6;
InitParams.MaxNumOfFilterNames = 1;
InitParams.MaxNumberOfPrivateDistributors = 2;