Browse Source

Test

etomic
jl777 7 years ago
parent
commit
36a1ae9fb4
  1. 8
      iguana/exchanges/LP_nativeDEX.c
  2. 2
      iguana/exchanges/LP_statemachine.c

8
iguana/exchanges/LP_nativeDEX.c

@ -1206,14 +1206,14 @@ int32_t zeroval() { return(0); }
void *LP_alloc(uint64_t len) void *LP_alloc(uint64_t len)
{ {
return(calloc(1,len)); //return(calloc(1,len));
LP_cjson_allocated += len; LP_cjson_allocated += len;
LP_cjson_total += len; LP_cjson_total += len;
LP_cjson_count++; LP_cjson_count++;
struct LP_memory_list *mp; struct LP_memory_list *mp;
mp = calloc(1,sizeof(*mp) + len); mp = calloc(1,sizeof(*mp) + len);
mp->ptr = calloc(1,len); mp->ptr = calloc(1,len);
//printf(">>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu %llu\n",mp,mp->ptr,(long long)len,(long long)LP_cjson_allocated); printf(">>>>>>>>>>> LP_alloc mp.%p ptr.%p len.%llu %llu\n",mp,mp->ptr,(long long)len,(long long)LP_cjson_allocated);
mp->timestamp = (uint32_t)time(NULL); mp->timestamp = (uint32_t)time(NULL);
mp->len = (uint32_t)len; mp->len = (uint32_t)len;
portable_mutex_lock(&LP_cJSONmutex); portable_mutex_lock(&LP_cJSONmutex);
@ -1225,7 +1225,7 @@ return(calloc(1,len));
void LP_free(void *ptr) void LP_free(void *ptr)
{ {
static uint32_t lasttime,unknown; static uint32_t lasttime,unknown;
free(ptr); return; //free(ptr); return;
uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp; uint32_t now; char str[65]; int32_t n,lagging; uint64_t total = 0; struct LP_memory_list *mp,*tmp;
if ( (now= (uint32_t)time(NULL)) > lasttime+60 ) if ( (now= (uint32_t)time(NULL)) > lasttime+60 )
{ {
@ -1262,7 +1262,7 @@ free(ptr); return;
portable_mutex_lock(&LP_cJSONmutex); portable_mutex_lock(&LP_cJSONmutex);
DL_DELETE(LP_memory_list,mp); DL_DELETE(LP_memory_list,mp);
portable_mutex_unlock(&LP_cJSONmutex); portable_mutex_unlock(&LP_cJSONmutex);
//printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u %llu\n",ptr,mp,mp->len,(long long)LP_cjson_allocated); printf(">>>>>>>>>>> LP_free ptr.%p mp.%p len.%u %llu\n",ptr,mp,mp->len,(long long)LP_cjson_allocated);
free(mp->ptr); free(mp->ptr);
free(mp); free(mp);
} else unknown++; // free from source file with #define redirect for alloc that wasnt } else unknown++; // free from source file with #define redirect for alloc that wasnt

2
iguana/exchanges/LP_statemachine.c

@ -1765,7 +1765,7 @@ void basilisk_swaploop(void *_utxo)
else tradebot_pendingadd(swapjson(swap),swap->I.req.dest,dstr(swap->I.req.destamount),swap->I.req.src,dstr(swap->I.req.srcamount)); else tradebot_pendingadd(swapjson(swap),swap->I.req.dest,dstr(swap->I.req.destamount),swap->I.req.src,dstr(swap->I.req.srcamount));
} }
printf("%s swap finished statebits %x\n",swap->I.iambob!=0?"BOB":"ALICE",swap->I.statebits); printf("%s swap finished statebits %x\n",swap->I.iambob!=0?"BOB":"ALICE",swap->I.statebits);
//basilisk_swap_purge(swap); basilisk_swap_purge(swap);
free(data); free(data);
} }
#endif #endif

Loading…
Cancel
Save