Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
9219793009
  1. 5
      iguana/iguana_ramchain.c

5
iguana/iguana_ramchain.c

@ -1230,9 +1230,11 @@ int32_t iguana_ramchain_free(struct iguana_ramchain *ramchain,int32_t deleteflag
struct iguana_kvitem *item,*tmp; struct iguana_kvitem *item,*tmp;
//if ( ramchain->H.ROflag != 0 && ramchain->hashmem == 0 ) //if ( ramchain->H.ROflag != 0 && ramchain->hashmem == 0 )
{ {
printf("Free A %p %p, %ld\n",ramchain->A,ramchain->creditsA,sizeof(*ramchain->A) * ramchain->H.data->numpkinds);
if ( ramchain->A != ramchain->creditsA ) if ( ramchain->A != ramchain->creditsA )
{
printf("Free A %p %p, numpkinds.%d %ld\n",ramchain->A,ramchain->creditsA,ramchain->H.data->numpkinds,sizeof(*ramchain->A) * ramchain->H.data->numpkinds);
myfree(ramchain->A,sizeof(*ramchain->A) * ramchain->H.data->numpkinds), ramchain->A = 0; myfree(ramchain->A,sizeof(*ramchain->A) * ramchain->H.data->numpkinds), ramchain->A = 0;
}
//if ( ramchain->U2 != ramchain->roU2 ) //if ( ramchain->U2 != ramchain->roU2 )
// myfree(ramchain->U2,sizeof(*ramchain->U2) * ramchain->H.data->numunspents), ramchain->U2 = 0; // myfree(ramchain->U2,sizeof(*ramchain->U2) * ramchain->H.data->numunspents), ramchain->U2 = 0;
//if ( ramchain->P2 != ramchain->roP2 ) //if ( ramchain->P2 != ramchain->roP2 )
@ -1290,6 +1292,7 @@ void iguana_ramchain_extras(struct iguana_ramchain *ramchain,struct OS_memspace
if ( (ramchain->hashmem= hashmem) != 0 ) if ( (ramchain->hashmem= hashmem) != 0 )
iguana_memreset(hashmem); iguana_memreset(hashmem);
ramchain->A = (hashmem != 0) ? iguana_memalloc(hashmem,sizeof(struct iguana_account) * ramchain->H.data->numpkinds,1) : mycalloc('p',ramchain->H.data->numpkinds,sizeof(struct iguana_account)); ramchain->A = (hashmem != 0) ? iguana_memalloc(hashmem,sizeof(struct iguana_account) * ramchain->H.data->numpkinds,1) : mycalloc('p',ramchain->H.data->numpkinds,sizeof(struct iguana_account));
printf("A allocated.%p numpkinds.%d %ld\n",ramchain->A,ramchain->H.data->numpkinds,sizeof(struct iguana_account)*ramchain->H.data->numpkinds);
//ramchain->P2 = (hashmem != 0) ? iguana_memalloc(hashmem,sizeof(struct iguana_pkextra) * ramchain->H.data->numpkinds,1) : mycalloc('2',ramchain->H.data->numpkinds,sizeof(struct iguana_pkextra)); //ramchain->P2 = (hashmem != 0) ? iguana_memalloc(hashmem,sizeof(struct iguana_pkextra) * ramchain->H.data->numpkinds,1) : mycalloc('2',ramchain->H.data->numpkinds,sizeof(struct iguana_pkextra));
///ramchain->U2 = (hashmem != 0) ? iguana_memalloc(hashmem,sizeof(struct iguana_Uextra) * ramchain->H.data->numunspents,1) : mycalloc('3',ramchain->H.data->numunspents,sizeof(struct iguana_Uextra)); ///ramchain->U2 = (hashmem != 0) ? iguana_memalloc(hashmem,sizeof(struct iguana_Uextra) * ramchain->H.data->numunspents,1) : mycalloc('3',ramchain->H.data->numunspents,sizeof(struct iguana_Uextra));
//printf("iguana_ramchain_extras A.%p:%p U2.%p:%p P2.%p:%p\n",ramchain->A,ramchain->roA,ramchain->U2,ramchain->roU2,ramchain->P2,ramchain->roP2); //printf("iguana_ramchain_extras A.%p:%p U2.%p:%p P2.%p:%p\n",ramchain->A,ramchain->roA,ramchain->U2,ramchain->roU2,ramchain->P2,ramchain->roP2);

Loading…
Cancel
Save