const struct GNUNET_GNSRECORD_Data *rd)
{
size_t ret;
- size_t no_padding;
ret = sizeof (struct NetworkRecord) * rd_count;
for (unsigned int i=0;i<rd_count;i++)
* power of 2 for padding
* https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
*/
- no_padding = ret;
ret--;
ret |= ret >> 1;
ret |= ret >> 2;
ret |= ret >> 8;
ret |= ret >> 16;
ret++;
- //If padding record does not fit, pad again.
- if ((ret - no_padding) < sizeof (struct NetworkRecord))
- ret = ret << 1;
return (ssize_t) ret;
}