Files
Nim/lib/pure
rockcavera e5639408d5 avoiding unnecessary allocation for dollar IpAddress (#21199)
* avoiding allocating an unnecessary byte for IPv4

The inet.h file uses 16 as the string in C needs the last null byte
1b929c02af/include/linux/inet.h (L49)

However, strings in Nim do not need this. So one byte is being allocated unnecessary and will never be used.

* avoid unnecessary allocation in IPv6 dollar

It is currently allocating 48 bytes. However, the Nim implementation for IPv6 will print a maximum of 39 characters. Nim does not implement IPv6 "0000:0000:0000:0000:0000:ffff:255.255.255.255" (45 characters) nor "0000:0000:0000:0000:0000:ffff:255.255.255.255%3" (47 characters). 

The indication in inet.h for 48 is due to the maximum use of 47 characters of a C string that needs a null byte at the end. So 48.
1b929c02af/include/linux/inet.h (L50)
2022-12-30 09:20:32 +01:00
..
2022-12-26 13:20:05 +01:00
2022-12-16 08:01:15 +01:00
2015-10-01 12:05:45 -07:00
2021-04-08 14:08:58 +02:00
2022-12-26 13:20:05 +01:00
2022-12-26 13:20:05 +01:00
2021-01-09 00:24:41 +01:00
2022-02-14 22:15:59 +00:00
2022-12-16 08:01:15 +01:00
2022-12-26 13:20:05 +01:00
2022-12-16 08:01:15 +01:00
2022-02-02 17:10:11 +01:00
2022-02-02 17:10:11 +01:00
2022-09-27 15:00:57 -04:00
2022-12-03 21:25:49 +08:00
2022-11-02 10:52:15 +01:00
2022-11-03 09:48:51 +01:00
2021-02-08 09:46:07 +01:00
2022-02-02 17:10:11 +01:00
2022-12-22 08:32:12 +01:00