Changeset View
Changeset View
Standalone View
Standalone View
src/leveldb/port/port_example.h
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | |||||
// ------------------ Miscellaneous ------------------- | // ------------------ Miscellaneous ------------------- | ||||
// If heap profiling is not supported, returns false. | // If heap profiling is not supported, returns false. | ||||
// Else repeatedly calls (*func)(arg, data, n) and then returns true. | // Else repeatedly calls (*func)(arg, data, n) and then returns true. | ||||
// The concatenation of all "data[0,n-1]" fragments is the heap profile. | // The concatenation of all "data[0,n-1]" fragments is the heap profile. | ||||
extern bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg); | extern bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg); | ||||
// Determine whether a working accelerated crc32 implementation exists | |||||
// Returns true if AcceleratedCRC32C is safe to call | |||||
bool HasAcceleratedCRC32C(); | |||||
// Extend the CRC to include the first n bytes of buf. | // Extend the CRC to include the first n bytes of buf. | ||||
// | // | ||||
// Returns zero if the CRC cannot be extended using acceleration, else returns | // Returns zero if the CRC cannot be extended using acceleration, else returns | ||||
// the newly extended CRC value (which may also be zero). | // the newly extended CRC value (which may also be zero). | ||||
uint32_t AcceleratedCRC32C(uint32_t crc, const char* buf, size_t size); | uint32_t AcceleratedCRC32C(uint32_t crc, const char* buf, size_t size); | ||||
} // namespace port | } // namespace port | ||||
} // namespace leveldb | } // namespace leveldb | ||||
#endif // STORAGE_LEVELDB_PORT_PORT_EXAMPLE_H_ | #endif // STORAGE_LEVELDB_PORT_PORT_EXAMPLE_H_ |