Browse Source

Test

etomic
jl777 7 years ago
parent
commit
3e0217af2b
  1. 4
      iguana/exchanges/LP_nativeDEX.c

4
iguana/exchanges/LP_nativeDEX.c

@ -1204,7 +1204,7 @@ void *LP_alloc(uint64_t len)
{
struct LP_memory_list *mp;
mp = calloc(1,sizeof(*mp));
printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,&mp[1],(long long)len);
//printf("\n>>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu\n",mp,mp->ptr,(long long)len);
mp->timestamp = (uint32_t)time(NULL);
mp->len = (uint32_t)len;
mp->ptr = calloc(1,len);
@ -1223,7 +1223,6 @@ void LP_free(void *ptr)
{
static uint32_t lasttime;
uint32_t now; int32_t n; uint64_t total = 0; struct LP_memory_list *mp,*tmp;
printf("\n>>>>>>>>>>> LP_free ptr.%p\n",ptr);
if ( (now= (uint32_t)time(NULL)) > lasttime+6 )
{
n = 0;
@ -1246,6 +1245,7 @@ void LP_free(void *ptr)
portable_mutex_lock(&LP_cJSONmutex);
DL_DELETE(LP_memory_list,mp);
portable_mutex_unlock(&LP_cJSONmutex);
printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u\n",ptr,mp,mp->len);
free(mp->ptr);
free(mp);
} // free from source file with #define redirect for alloc that wasnt

Loading…
Cancel
Save