dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

Ātrs jautājums

 
dev.gamez.lv Forum Index -> Iesācējiem
View previous topic :: View next topic  
Author Message
Tenjou



Joined: 22 Nov 2005
Posts: 275

PostPosted: Wed Aug 16, 2006 6:50 pm    Post subject: Ātrs jautājums

Ja izveido klasi ->

Code:
Klase *jaunaKlase = new Klase[65535];


Klases izmers ir 34byte un kopa izmērs izveidojās 2`228`190byte. Šīs atmiņas daudzums tiek patērēts no RAM`a vai RAM`u izmanto tikai, kad tiek veiktas darbības ar šo klasi?
Back to top
View user's profile
bubu
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 23 Mar 2004
Posts: 3223
Location: Riga

PostPosted: Wed Aug 16, 2006 7:51 pm    Post subject:

Šajā koda fragmentā tu izveido nevis jaunu klasi, bet daudz klases "Klase" objektus - kopskaitā 65535 gabalus.

Atmiņa tiek izdalīta uzreiz, jo to jau dara new operators - izdala atmiņu.
Back to top
View user's profile Send e-mail
Display posts from previous:   
dev.gamez.lv Forum Index -> Iesācējiem All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group