[GRASS-dev] storing pointers in CELL_TYPE maps?

Glynn Clements glynn at gclements.plus.com
Fri Apr 27 04:50:39 EDT 2007


Volker Wichmann wrote:

> I'd like to store pointers in CELL_TYPE maps. These pointers contain the
> adresses of the first element of linked lists (containing special
> attributes for each cell of the raster map). This works out fine on my
> machine, but I'm afraid this might not be the case on others. Is it safe
> or just an ugly hack?

What do you mean by "store"? Storing pointers in files is usually
pointless, as they are normally only useful so long as the original
process persists.

If you're talking about storing them in memory in CELL arrays, that
won't normally work on 64-bit systems, where a CELL (i.e. "int") is 32
bits but pointers are 64 bits.

If the list nodes are of fixed size, it's likely to be better to have
a single array of nodes and uses indices to reference individual
nodes.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list