This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline constexpr uint32_t ceilPowerOfTwo(uint32_t num) { | |
num |= (num >> 1); | |
num |= (num >> 2); | |
num |= (num >> 4); | |
num |= (num >> 8); | |
num |= (num >> 16); | |
return num - (num >> 1); | |
} | |
inline constexpr uint32_t roundupPowerOfTwo(uint32_t num) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class connbase { | |
public: | |
virtual void Send() = 0; | |
}; | |
typedef enum { | |
WithEnc, | |
WithoutEnc | |
}enc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by TrevorProfessor on 2019-09-18. | |
// | |
#include <cstring> | |
#include "bytes_buf.hpp" | |
static int align128(int v) { | |
#define CACHE_LINE_SIZE 128 |