Some micro-optimizations, including a memcpy that is faster than Linux for most distro/compiler versions.
This commit is contained in:
parent
cb8e7b4d5e
commit
0608704626
22 changed files with 163 additions and 81 deletions
|
@ -1971,7 +1971,7 @@ public:
|
|||
// After setting up tap, fall through to CONFIG_UPDATE since we also want to do this...
|
||||
|
||||
case ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_CONFIG_UPDATE:
|
||||
memcpy(&(n.config),nwc,sizeof(ZT_VirtualNetworkConfig));
|
||||
ZT_FAST_MEMCPY(&(n.config),nwc,sizeof(ZT_VirtualNetworkConfig));
|
||||
if (n.tap) { // sanity check
|
||||
#ifdef __WINDOWS__
|
||||
// wait for up to 5 seconds for the WindowsEthernetTap to actually be initialized
|
||||
|
@ -2298,7 +2298,7 @@ public:
|
|||
else return 0;
|
||||
const std::vector<InetAddress> *l = lh->get(ztaddr);
|
||||
if ((l)&&(l->size() > 0)) {
|
||||
memcpy(result,&((*l)[(unsigned long)_node->prng() % l->size()]),sizeof(struct sockaddr_storage));
|
||||
ZT_FAST_MEMCPY(result,&((*l)[(unsigned long)_node->prng() % l->size()]),sizeof(struct sockaddr_storage));
|
||||
return 1;
|
||||
} else return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue