Fabio Alessandrelli
cbc772d696
Fix buffers size calculation in PacketPeerStream.
...
The calculation used to be wrong when exactly at a power of 2.
`nearest_shift` always return the "next" power of 2
`nearest_shift(4) == 3 # 2^3 = 8`.
On the other hand `next_power_of_2` returns the exact value if that
value is a power of 2 (i.e. `next_power_of_2(4) == 4`).
I.e. :
```
WARN_PRINT(itos(next_power_of_2(4)) + " " + itos(1 << nearest_shift(4)));
// WARNING: ... : 4 8
```
Is this by design?
2019-12-22 15:35:44 +01:00
..
2019-12-04 11:14:21 +01:00
2019-10-28 08:07:29 +01:00
2019-12-22 15:35:44 +01:00
2019-12-13 23:29:52 +01:00
2019-12-04 11:14:21 +01:00
2019-09-24 21:33:09 +02:00
2019-09-14 13:08:28 -07:00
2019-09-25 10:28:50 +02:00
2019-11-28 22:57:27 +01:00
2019-05-24 20:37:40 +01:00
2019-10-14 16:46:54 -04:00
2019-10-14 16:46:54 -04:00
2019-02-16 04:00:19 +01:00
2019-08-12 04:26:38 -05:00
2019-10-14 11:40:55 +02:00
2019-01-01 12:58:10 +01:00
2018-09-15 14:45:54 +02:00
2019-05-03 15:06:05 -07:00
2019-05-03 15:06:05 -07:00
2019-10-08 11:03:57 +02:00
2019-10-10 18:12:20 +02:00
2019-04-20 02:01:55 +02:00
2019-09-25 10:28:50 +02:00
2019-07-11 08:25:26 +01:00
2019-06-27 12:48:26 +02:00
2019-11-11 10:57:00 +01:00
2019-11-13 14:21:32 +01:00
2019-08-08 11:58:57 +03:00
2019-08-08 11:58:57 +03:00
2019-06-27 12:48:26 +02:00
2019-02-12 13:34:25 +01:00
2019-10-24 08:18:34 +02:00
2019-02-12 13:34:25 +01:00
2019-11-01 16:16:31 +01:00
2019-09-25 10:28:50 +02:00
2019-09-25 10:28:50 +02:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-10-08 11:03:57 +02:00
2019-07-23 09:14:31 +02:00
2019-10-08 11:03:57 +02:00
2019-12-10 05:13:02 +01:00
2019-05-09 06:25:32 -04:00
2019-01-01 12:58:10 +01:00
2019-08-12 04:26:38 -05:00
2019-01-01 12:58:10 +01:00
2019-10-09 15:44:00 +02:00
2019-08-12 04:26:38 -05:00
2019-09-21 14:32:40 +08:00
2019-12-18 19:32:00 -03:00
2019-08-17 14:20:16 +02:00
2019-04-20 02:01:55 +02:00
2019-10-28 08:07:29 +01:00
2019-01-01 12:58:10 +01:00
2019-01-30 06:43:56 +01:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-08-17 12:33:15 +02:00
2019-01-01 12:58:10 +01:00
2019-08-17 12:33:15 +02:00
2019-10-31 16:27:32 +01:00
2019-05-30 10:28:03 +02:00
2019-01-01 12:58:10 +01:00
2019-12-20 10:42:08 +08:00
2019-09-25 15:29:59 +02:00
2019-10-28 18:32:00 +01:00
2019-10-28 18:32:00 +01:00
2019-09-04 12:17:07 +08:00
2019-09-04 12:17:07 +08:00
2019-08-21 16:59:38 +02:00
2019-08-12 04:26:38 -05:00
2019-10-21 13:53:45 +02:00
2019-10-21 13:53:45 +02:00
2019-01-01 12:58:10 +01:00
2019-08-12 04:26:38 -05:00
2019-01-01 12:58:10 +01:00
2019-01-01 12:58:10 +01:00
2019-09-04 12:17:07 +08:00
2019-09-03 20:49:09 +02:00
2019-09-03 20:49:09 +02:00
2019-10-08 11:54:29 +02:00
2019-10-23 02:51:32 +01:00
2019-11-03 10:37:48 -06:00
2019-10-08 11:03:57 +02:00
2019-08-12 04:26:38 -05:00
2019-01-01 12:58:10 +01:00
2019-10-08 11:03:57 +02:00
2019-01-01 12:58:10 +01:00
2019-10-03 19:14:29 +02:00
2019-04-19 02:11:39 +02:00
2019-07-20 08:09:57 +02:00
2019-08-12 04:26:38 -05:00
2019-12-04 16:53:40 +01:00
2019-12-04 16:53:08 +01:00
2019-07-22 00:08:35 +02:00
2019-11-20 16:22:16 +01:00
2019-04-05 11:10:15 +03:00
2019-06-26 16:32:34 +02:00
2019-06-26 16:32:34 +02:00
2019-12-20 10:42:08 +08:00
2019-12-20 10:42:08 +08:00
2019-12-15 12:31:08 -05:00
2019-12-12 20:00:26 +01:00
2019-12-20 10:42:08 +08:00
2019-01-01 12:58:10 +01:00
2019-10-24 15:14:55 +03:00
2019-08-12 04:26:38 -05:00
2019-06-11 14:49:34 +02:00
2019-02-17 13:38:52 +01:00
2019-10-24 08:18:34 +02:00
2019-04-05 23:41:51 +02:00