Reputation: 1781
Anyone know why certain fields in proc.h in Minix are char, when I thought they'd be int?
37 char p_ticks_left; /* number of scheduling ticks left */
38 char p_quantum_size; /* quantum size in ticks */
So, if we want to add a new "int" field should we make it a char?
Upvotes: 2
Views: 1752
Reputation: 138
consider from design, maybe It's enough to save value of "number of scheduling ticks left" and "quantum size in ticks". and size of char is smaller than size of int.
Upvotes: 0
Reputation: 62068
If char
is big enough to hold all the necessary values, why not use it? Of course, int
may be somewhat more performant, but at the same time char
is usually smaller.
I believe you can use any type that makes sense.
Upvotes: 1