Skip to content

Commit

Permalink
some functions to see write-varint object code
Browse files Browse the repository at this point in the history
Reviewed By: iahs

Differential Revision: D67108184

fbshipit-source-id: f1bfdf0994bb045610b1b8cd76f823c2ec3464a6
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Dec 12, 2024
1 parent 4acb057 commit 6db110c
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,51 @@
#include <folly/io/Cursor.h>
#include <folly/io/IOBuf.h>
#include <folly/io/IOBufQueue.h>
#include <folly/lang/Keep.h>
#include <thrift/lib/cpp/util/test/VarintUtilsTestUtil.h>

using namespace apache::thrift::util;

extern "C" FOLLY_KEEP uint8_t check_thrift_write_varint_u8_cursor(
folly::io::QueueAppender* cur, uint8_t val) {
return writeVarint(*cur, val);
}

extern "C" FOLLY_KEEP uint8_t check_thrift_write_varint_u16_cursor(
folly::io::QueueAppender* cur, uint16_t val) {
return writeVarint(*cur, val);
}

extern "C" FOLLY_KEEP uint8_t check_thrift_write_varint_u32_cursor(
folly::io::QueueAppender* cur, uint32_t val) {
return writeVarint(*cur, val);
}

extern "C" FOLLY_KEEP uint8_t check_thrift_write_varint_u64_cursor(
folly::io::QueueAppender* cur, uint64_t val) {
return writeVarint(*cur, val);
}

extern "C" FOLLY_KEEP uint8_t check_thrift_write_varint_u8_cursor_unrolled(
folly::io::QueueAppender* cur, uint8_t val) {
return writeVarintUnrolled(*cur, val);
}

extern "C" FOLLY_KEEP uint8_t check_thrift_write_varint_u16_cursor_unrolled(
folly::io::QueueAppender* cur, uint16_t val) {
return writeVarintUnrolled(*cur, val);
}

extern "C" FOLLY_KEEP uint8_t check_thrift_write_varint_u32_cursor_unrolled(
folly::io::QueueAppender* cur, uint32_t val) {
return writeVarintUnrolled(*cur, val);
}

extern "C" FOLLY_KEEP uint8_t check_thrift_write_varint_u64_cursor_unrolled(
folly::io::QueueAppender* cur, uint64_t val) {
return writeVarintUnrolled(*cur, val);
}

FOLLY_CREATE_QUAL_INVOKER_SUITE(write_unrolled, writeVarintUnrolled);
#ifdef __BMI2__
FOLLY_CREATE_QUAL_INVOKER_SUITE(write_bmi2, writeVarintBMI2);
Expand Down

0 comments on commit 6db110c

Please sign in to comment.