Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
dc9d48cde3
  1. 2
      crypto777/iguana_OS.c
  2. 7
      iguana/iguana_ramchain.c

2
crypto777/iguana_OS.c

@ -406,6 +406,8 @@ int64_t iguana_memallocated(struct OS_memspace *mem)
void *iguana_memalloc(struct OS_memspace *mem,long size,int32_t clearflag) void *iguana_memalloc(struct OS_memspace *mem,long size,int32_t clearflag)
{ {
int32_t modval; void *ptr = 0; int32_t modval; void *ptr = 0;
if ( mem->ptr == 0 )
return(0);
//printf("iguana_memalloc.%s size.%ld used.%llu of %llu, numptrs.%d avail.%d %lld\n",mem->name,size,(long long)mem->used,(long long)mem->totalsize,mem->numptrs,mem->availptrs,(long long)iguana_memallocated(mem)); //printf("iguana_memalloc.%s size.%ld used.%llu of %llu, numptrs.%d avail.%d %lld\n",mem->name,size,(long long)mem->used,(long long)mem->totalsize,mem->numptrs,mem->availptrs,(long long)iguana_memallocated(mem));
//if ( mem->threadsafe != 0 ) //if ( mem->threadsafe != 0 )
// portable_mutex_lock(&mem->mutex); // portable_mutex_lock(&mem->mutex);

7
iguana/iguana_ramchain.c

@ -1297,10 +1297,9 @@ int32_t iguana_ramchain_extras(struct iguana_info *coin,struct iguana_ramchain *
if ( (ramchain->hashmem= hashmem) != 0 ) if ( (ramchain->hashmem= hashmem) != 0 )
iguana_memreset(hashmem); iguana_memreset(hashmem);
else printf("alloc ramchain->A %ld\n",sizeof(struct iguana_account) * ramchain->H.data->numpkinds); else printf("alloc ramchain->A %ld\n",sizeof(struct iguana_account) * ramchain->H.data->numpkinds);
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 && hashmem->ptr != 0) ? iguana_memalloc(hashmem,sizeof(struct iguana_account) * ramchain->H.data->numpkinds,1) : mycalloc('p',ramchain->H.data->numpkinds,sizeof(struct iguana_account));
ramchain->Uextras = (hashmem != 0) ? iguana_memalloc(hashmem,sizeof(*ramchain->Uextras) * ramchain->H.data->numunspents,1) : mycalloc('p',ramchain->H.data->numunspents,sizeof(*ramchain->Uextras)); ramchain->Uextras = (hashmem != 0 && hashmem->ptr != 0) ? iguana_memalloc(hashmem,sizeof(*ramchain->Uextras) * ramchain->H.data->numunspents,1) : mycalloc('p',ramchain->H.data->numunspents,sizeof(*ramchain->Uextras));
} } else err = iguana_volatilesmap(coin,ramchain);
else err = iguana_volatilesmap(coin,ramchain);
} }
return(err); return(err);
} }

Loading…
Cancel
Save