gcc 4.0 以上的版本中支持通过 __attribute__((visibility("default")))
来显示符号,__attribute__((visibility("hidden")))
来隐藏符号
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 Utf8Iterator | |
{ | |
public: | |
Utf8Iterator(const char* data, size_t size): mData(data), mSize(size), mPos(0) {} | |
~Utf8Iterator() {} | |
bool HasNext() const | |
{ | |
return mPos < mSize; | |
} |
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
std::string char_to_hex(unsigned char input) | |
{ | |
static const char* const dict = "0123456789ABCDEF"; | |
std::string result("0x"); | |
result.push_back(dict[input >> 4]); | |
result.push_back(dict[input & 0x0F]); | |
return result; | |
} |
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
#include <string> | |
#include <iostream> | |
#include "llvm/ExecutionEngine/JIT.h" | |
#include "llvm/ADT/OwningPtr.h" | |
#include "llvm/Bitcode/ReaderWriter.h" | |
#include "llvm/IR/LLVMContext.h" | |
#include "llvm/IR/Module.h" | |
#include "llvm/Support/FileSystem.h" |
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
#include <assert.h> | |
class MemoryManager | |
{ | |
public: | |
MemoryManager(); | |
~MemoryManager(); | |
char* Allocate(size_t bytes); | |
char* AllocateAligned(size_t bytes); | |
size_t GetTotal() const { return mTotal; } |
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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
package chunk | |
import ( | |
"container/list" | |
"sync" | |
"testing" | |
) | |
// implementation and benchmark of colPoolSlice. | |
type colPoolSlice struct { |
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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" General | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" set how many lines of history VIM has to remember | |
set history=1000 | |
" enable filetype plugins | |
" filetype plugin on | |
" filetype indent on | |
filetype on |
OlderNewer