Why MySQL allocates a fixed memory types?

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
For example, under the type int is allocated 4 bytes, although it may be number 5, which takes 3 bits
Why this happens dynamically, so there is no leakage in the case of small numbers?
by | 19 views

1 Answer

0 like 0 dislike
Excuse me, but how does the CPU know what You were referring to the number 5?
I mean here he is running on memory stumbles upon a sequence of bits each beat of your life. How will he know what you wanted exactly three bits under the number to allocate? He'll need some hint, say some piece of memory, where you will write the number 3 (bits), right? But number 3 is actually two bits (11) in binary. And as he to guess that you in the tip, exactly 2 bits used? Understand what is the problem?

And in General

Related questions

0 like 0 dislike
4 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
7 answers
asked Mar 21, 2019 by Artqookie
110,608 questions
257,187 answers
40,796 users