Click here to Skip to main content
15,896,513 members
Home / Discussions / C#
   

C#

 
GeneralRe: Loading an Icon Resource Pin
Scott Dorman20-Apr-08 5:14
professionalScott Dorman20-Apr-08 5:14 
GeneralRe: Loading an Icon Resource Pin
#realJSOP20-Apr-08 5:41
professional#realJSOP20-Apr-08 5:41 
GeneralRe: Loading an Icon Resource Pin
Scott Dorman20-Apr-08 6:44
professionalScott Dorman20-Apr-08 6:44 
QuestionSorting data using BindingSource.Sort Pin
Alessandra7720-Apr-08 4:04
Alessandra7720-Apr-08 4:04 
QuestionOutofMemoryException Pin
Ian Grech20-Apr-08 2:57
Ian Grech20-Apr-08 2:57 
GeneralRe: OutofMemoryException Pin
Luc Pattyn20-Apr-08 3:10
sitebuilderLuc Pattyn20-Apr-08 3:10 
GeneralRe: OutofMemoryException Pin
Jordanwb20-Apr-08 4:09
Jordanwb20-Apr-08 4:09 
GeneralRe: OutofMemoryException Pin
Luc Pattyn20-Apr-08 13:08
sitebuilderLuc Pattyn20-Apr-08 13:08 
I am pretty sure a bool actually takes "at least 1 byte", i.e. it would take 1 byte
if you need four class fields of type bool, they would sit together and not disturb
any alignment requirements of adjacent data members. And they would occupy 1 byte
when a lot of them are stored in an array.

In most other cases they would end up taking more bytes, often 4 (or even 8 on Win64);
and when boxed into a Collection, they would grow from 1 to 40/44: alignment grows them
from 1 to 4, administration (object info) adds some 32, and the collection itself needs
a pointer (either 4 or 8), assuming the hashing and/or links in the collection don't
add to that.

Hence IMO the statement "bool = 1 byte" is an oversimplification.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.


modified on Sunday, April 20, 2008 7:59 PM

GeneralRe: OutofMemoryException Pin
Jordanwb20-Apr-08 13:24
Jordanwb20-Apr-08 13:24 
GeneralRe: OutofMemoryException Pin
Luc Pattyn20-Apr-08 14:07
sitebuilderLuc Pattyn20-Apr-08 14:07 
GeneralRe: OutofMemoryException Pin
Jordanwb20-Apr-08 15:46
Jordanwb20-Apr-08 15:46 
GeneralRe: OutofMemoryException Pin
Ian Grech20-Apr-08 23:40
Ian Grech20-Apr-08 23:40 
GeneralRe: OutofMemoryException Pin
Ian Grech22-Apr-08 22:14
Ian Grech22-Apr-08 22:14 
AnswerRe: OutofMemoryException Pin
Ian Grech28-Apr-08 10:52
Ian Grech28-Apr-08 10:52 
GeneralRe: OutofMemoryException Pin
Scott Dorman20-Apr-08 4:42
professionalScott Dorman20-Apr-08 4:42 
GeneralRe: OutofMemoryException Pin
Ian Grech20-Apr-08 23:24
Ian Grech20-Apr-08 23:24 
GeneralRe: OutofMemoryException Pin
Jordanwb21-Apr-08 2:39
Jordanwb21-Apr-08 2:39 
GeneralRe: OutofMemoryException Pin
Scott Dorman22-Apr-08 16:58
professionalScott Dorman22-Apr-08 16:58 
GeneralSystem.CodeDom Problem. Pin
hdv21219-Apr-08 22:55
hdv21219-Apr-08 22:55 
GeneralRe: System.CodeDom Problem. Pin
Rob Smiley20-Apr-08 0:46
Rob Smiley20-Apr-08 0:46 
GeneralUnable to fill certain fields inside the DOM of some websites! Pin
alon198019-Apr-08 21:50
alon198019-Apr-08 21:50 
GeneralRe: Unable to fill certain fields inside the DOM of some websites! Pin
alon198021-Apr-08 4:36
alon198021-Apr-08 4:36 
GeneralFinalizer implementation Pin
George_George19-Apr-08 21:20
George_George19-Apr-08 21:20 
GeneralRe: Finalizer implementation Pin
Scott Dorman20-Apr-08 4:57
professionalScott Dorman20-Apr-08 4:57 
GeneralRe: Finalizer implementation Pin
carbon_golem20-Apr-08 5:29
carbon_golem20-Apr-08 5:29 

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.