I've heard that (most) Operating Systems require programs to allocate memory in byte chunks, I. E: a boolean value must be a byte wide when a single bit would do. Is there a particular reason why you can't allocate a bit?
Asked
Active
Viewed 128 times
1
-
This question appears to be off-topic because it is about operating system design and not about a program that isn't working. – Raymond Chen Oct 21 '14 at 01:31
-
1(And technically it is possible to allocate a single bit, but the overhead for an allocation is usually eight bytes or more, so allocating a single bit would be rather inefficient. If you look closely, most operating systems don't let you allocate a single byte either. The minimum is usually around eight or sixteen bytes.) – Raymond Chen Oct 21 '14 at 01:33
1 Answers
1
The smallest unit of addressable memory is a byte. It is physically not possible for the CPU to load a single bit of memory.
Thilo
- 250,062
- 96
- 490
- 643
-
Sorry if this is getting progressively off-topic, but why is it designed that way? – Timidger Oct 21 '14 at 01:35