Snapchat / KeyDB

A Multithreaded Fork of Redis
https://keydb.dev
BSD 3-Clause "New" or "Revised" License
11.02k stars 564 forks source link

fix build on 32bit systems #780

Closed DarthBo closed 4 months ago

DarthBo commented 5 months ago

The replication code has an assert that tests if sizeof(long) == sizeof(long long), which obviously fails on 32-bit architectures.

I believe the assert is incorrect on any architecture, considering the following code is actually putting a long long in an int (rsi.repl_stream_db).

I replaced it with code that checks if the value fits in an int, and throws otherwise.