Re: 100k X 100k data processing summary



Barry Schwarz <schwarzb@xxxxxxxxx> writes:

On Sun, 25 Nov 2007 05:28:00 +0800, "a" <a@xxxxx> wrote:

By previous replies, it seems that the following method somehow solves the
problem up to 1000 * 1000 2D data, but when I try 10k * 10k, the
segmentation fault problem appears again.

Richard Tobin told me there is a system limit that can be changed. But I
don't know which file is to be changed.

I have modified again and again and hope to find out a solution that can
handle 100k * 100k data.

float** array_to_matrix(float* m, int rows, int cols) {
int i,j;

float** r;

r = (float**)calloc(rows,sizeof(float*));

The cast is worse than useless. It can actually have a negative
impact on your development process

How? Certainly during debugging it makes perfect sense to zero a new
block if for nothing else than examining the memory. In the real world
that is.


You are aware that calloc sets the allocated area to all bits zero and
this need not be suitable for pointers.

I need this explaining once again.

ptr = (float*) *fltPointer++;

If its all bit 0s then surely assignment of 0 will cast to the "real
null for that pointer type".

Or would you actually advocate writing your own loop applying a "null"
for float * to the memory block?
.



Relevant Pages

  • Re: int or bool?
    ... The idea of zero being false is much more natural, also, since it is often ... used when evaluating pointers (esp. ... A poiinter is essentially an unsigned integer value, ... Hiding that implied condition ...
    (comp.lang.cpp)
  • Re: pointer_to_function?
    ... I hope) is that lineptr is cast to an array of void pointers. ...
    (comp.lang.c)
  • Mysterious pointer mixed with array indices bug
    ... buried deep in somebody else's massive package but it boils down to this, two pointers are declared, the first is: ... 804b6e8 #correctly points to first string ... All accesses to atoms->resname work before the memory ... work before and after the memory block is reassigned. ...
    (comp.lang.c)
  • Re: structures, structures and more structures (questions about nested structures)
    ... Filling the memory block with all bits to zero may produce ... If you insist (not typed pointers in a generic context), ... the answer the same if I have to issue seperate calls to allocate ...
    (comp.lang.c)
  • Re: Why does rewind() ignore errors?
    ... promise that memsetting any scalar to zero on their implementations ... Could anyone name actual architectures where this is not true? ... often valid reasons to use something other than all-bits-zero for null ... pointers were represented as 1; since the system trapped on attempts ...
    (comp.std.c)