Malloc + 2d arrays + C

Giorgos Keramidas keramida at ceid.upatras.gr
Wed Mar 20 18:50:02 EET 2002


On 2002-03-19 23:41, Christos Ricudis wrote:
> In article <mailman.1016575926.18713.linux-greek-users at lists.hellug.gr>, Vasilis Vasaitis wrote:
> Pragma poy einai o lan8asmenos tropos na ylopoihseis ena disdiastato array,
> otan ta bounds ths deyterhs diastashs einai constant, poso mallon a priori
> gnwsta.
>
> Sthn periptwsh toy 'disdiastatou array' exeis :
>
> * Ena memory allocation sto initialization
> * Ena pollaplasiasmo kai mia pros8esh ana access
> * Ena memory deallocation sto telos
>
> Sthn periptwsh toy 'array of N pointers' exeis :
>
> * N memory allocations sto initialization (+ malloc housekeeping)
> * To fetching toy pointer kai mia pros8esh ana access
> * N memory deallocations sto telos
>
> Poio apo ta dyo sou fainetai pio aplo, grhgoro, cache friendly, ktl ktl ktl?

Analoga to access pattern twn array elements :P

Giorgos Keramidas                       FreeBSD Documentation Project
keramida@{freebsd.org,ceid.upatras.gr}  http://www.FreeBSD.org/docproj/



More information about the Linux-greek-users mailing list