Click here to Skip to main content
16,004,833 members
Home / Discussions / C#
   

C#

 
GeneralRe: Threading, Suspend() Pin
Jared Parsons30-Dec-05 10:30
Jared Parsons30-Dec-05 10:30 
GeneralRe: Threading, Suspend() Pin
tray_gator30-Dec-05 10:44
tray_gator30-Dec-05 10:44 
QuestionI know this noob but.. Pin
wednesday™ -LJX-30-Dec-05 7:29
wednesday™ -LJX-30-Dec-05 7:29 
AnswerRe: I know this noob but.. Pin
Drew McGhie30-Dec-05 8:14
Drew McGhie30-Dec-05 8:14 
AnswerRe: I know this noob but.. Pin
Xodiak30-Dec-05 8:16
Xodiak30-Dec-05 8:16 
QuestionStructure/Memory Question Pin
bpreston30-Dec-05 7:11
bpreston30-Dec-05 7:11 
AnswerRe: Structure/Memory Question Pin
Judah Gabriel Himango30-Dec-05 8:14
sponsorJudah Gabriel Himango30-Dec-05 8:14 
GeneralRe: Structure/Memory Question Pin
Jared Parsons30-Dec-05 9:43
Jared Parsons30-Dec-05 9:43 
Judah Himango wrote:
System.Collections.Generic.List<mystructure> list = new List<mystructure>();
list.Add(new MyStructure());


This also comes with a cost (almost always small). Generic classes like any other must go through a JIT Compile the first time they are used/accessed. As you can imagine, the JIT'd assembly for all of the generic classes and methods for objects is the same since you are just manipulating a pointer. So as long as you are using reference types as your generic paramaters then you only suffer the JIT penalty once and also one memory overhead hit.

Structs are a bit different though since they are allocated on the stack and have varying range in sizes. The JIT'er is forced to JIT separate code for each different set of generic parameters that includes at least one ValueType. This means an extra JIT and the associated memory that comes with the JIT.

Jared Parsons
jaredp@beanseed.org
http://jaredparsons.blogspot.com/
GeneralRe: Structure/Memory Question Pin
Judah Gabriel Himango30-Dec-05 9:50
sponsorJudah Gabriel Himango30-Dec-05 9:50 
GeneralRe: Structure/Memory Question Pin
Jared Parsons30-Dec-05 10:15
Jared Parsons30-Dec-05 10:15 
GeneralRe: Structure/Memory Question Pin
bpreston30-Dec-05 11:15
bpreston30-Dec-05 11:15 
QuestionCan&#180;t print multiple pages in C# Pin
naglbitur30-Dec-05 6:48
naglbitur30-Dec-05 6:48 
AnswerRe: Can&amp;#180;t print multiple pages in C# Pin
Brian Van Beek30-Dec-05 6:52
Brian Van Beek30-Dec-05 6:52 
QuestionCna't Write To Hard Disk .Net 1.1 Sercurity Problem Pin
half_ex30-Dec-05 6:14
half_ex30-Dec-05 6:14 
AnswerRe: Cna't Write To Hard Disk .Net 1.1 Sercurity Problem Pin
Jared Parsons30-Dec-05 10:09
Jared Parsons30-Dec-05 10:09 
GeneralRe: Cna't Write To Hard Disk .Net 1.1 Sercurity Problem Pin
half_ex31-Dec-05 6:56
half_ex31-Dec-05 6:56 
GeneralRe: Cna't Write To Hard Disk .Net 1.1 Sercurity Problem Pin
half_ex1-Jan-06 7:16
half_ex1-Jan-06 7:16 
QuestionOpen outlook By pressing bottom Pin
abalfazl30-Dec-05 4:39
abalfazl30-Dec-05 4:39 
AnswerRe: Open outlook By pressing bottom Pin
Sam 200630-Dec-05 6:18
Sam 200630-Dec-05 6:18 
Questionpreventing a form from closing Pin
navvara the infantryman30-Dec-05 3:23
navvara the infantryman30-Dec-05 3:23 
AnswerRe: preventing a form from closing Pin
Sasuko30-Dec-05 3:26
Sasuko30-Dec-05 3:26 
GeneralRe: preventing a form from closing Pin
navvara the infantryman30-Dec-05 3:33
navvara the infantryman30-Dec-05 3:33 
AnswerRe: preventing a form from closing Pin
Darryl Borden30-Dec-05 4:00
Darryl Borden30-Dec-05 4:00 
GeneralRe: preventing a form from closing Pin
Dan Neely30-Dec-05 5:51
Dan Neely30-Dec-05 5:51 
Questionhow to show out the photo from access database??? Pin
jasonyip_200530-Dec-05 3:15
jasonyip_200530-Dec-05 3:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.