trachten / cpisync

A library for synchronizing remote data with minimum communication.
GNU General Public License v3.0
26 stars 11 forks source link

commRecv_Cuckoo() #57

Open trachten opened 4 years ago

trachten commented 4 years ago

Why does this receive longs when the constructor parameters are size_t's?

novakboskov commented 4 years ago

I assumed that long and size_t are of the same size (8 bytes on 64-bit platforms). Do you think that I should have better written a size_t Communicant::commRecv_size_t()? There are systems we want to support where narrow_cast<size_t>(long) would fail?

trachten commented 4 years ago

You shouldn’t assume that size_t == long. It’s not necessarily the case on other systems.

On Jul 21, 2020, at 9:31 PM, Novak Boškov notifications@github.com wrote:

I assumed that long and size_t are of the same size (8 bytes on 64-bit platforms). Do you think that I should have better written a size_t Communicant::commRecv_size_t()? There are systems we want to support where narrow_cast(long) would fail?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/trachten/cpisync/issues/57#issuecomment-662189917, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACM5LU3B2NCR7G45ZHUSR43R4Y6OPANCNFSM4NUUMPEQ.


Prof. Ari Trachtenberg ECE, Boston University trachten@bu.edu http://people.bu.edu/trachten