diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-12-15 11:03:20 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-12-15 11:03:20 -0800 |
commit | 060870462606f82d3a9b0fe6aca87f8a5de8705e (patch) | |
tree | 2001ea775c3a8b65c756d64fff88c664c609feb3 /service | |
parent | cb8e7b4d5e3cb4c5b79ccb9f74c161182222daca (diff) | |
download | infinitytier-060870462606f82d3a9b0fe6aca87f8a5de8705e.tar.gz infinitytier-060870462606f82d3a9b0fe6aca87f8a5de8705e.zip |
Some micro-optimizations, including a memcpy that is faster than Linux for most distro/compiler versions.
Diffstat (limited to 'service')
-rw-r--r-- | service/OneService.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/service/OneService.cpp b/service/OneService.cpp index b30dc390..3ca75362 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -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; } |