Post
Topic
Re: [ANN][RIC] Riecoin: constellations POW *CPU* HARD FORK successful, world record
by
IGJ
on 18/08/2018, 11:27:08 UTC
Unfortunately, as I did not study the miner optimizations, I do not have any idea of what are the "segment hits" :| ...

My quick look over the code, leading me to few thoughts... As I understand segment_hits is pointer to array of pointers, the way you declare it, and use it may lead to sure memory leaks. In C (not sure for C++ but should be same) when you just declare pointer, it points to nowhere in the memory.
In C I would declare and initialize it like this...

uint32_t **segment_hits;
sgment_hits = malloc( maxiter * sizeof(uint32_t *) );
if ( !segment_hits ) {do something allocation of memory failed}
for (int i=0; i < maxiter; i++) {
   segmet_hits\[i\] = malloc( entriesPerSegment * sizeof(uint32_t) );
   if ( !segment_hits\[i\] ) {do something allocation of memory failed}
}
note: The forum do not allow me to directly put "[" and "]" thats why I'm escaping them.

Also check deeper the code, because from what i see usage of segment_hits in your code may go out of array boundaries. Anyway, when I start riecoin community forum we may move there to talk for that and to look deeper in codes Smiley

Hope this helps.