perl: inlining the small functions

This commit is contained in:
tokuhirom 2010-09-10 21:18:45 +09:00
parent 0cd31a4b96
commit 0c4f0de13d

View File

@ -43,7 +43,7 @@ static void need(enc_t *enc, STRLEN len);
#define ERR_NESTING_EXCEEDED "perl structure exceeds maximum nesting level (max_depth set too low?)"
static void need(enc_t *enc, STRLEN len)
STATIC_INLINE void need(enc_t *enc, STRLEN len)
{
if (enc->cur + len >= enc->end) {
STRLEN cur = enc->cur - (char *)SvPVX (enc->sv);
@ -56,7 +56,7 @@ static void need(enc_t *enc, STRLEN len)
static int s_pref_int = 0;
static int pref_int_set(pTHX_ SV* sv, MAGIC* mg) {
STATIC_INLINE int pref_int_set(pTHX_ SV* sv, MAGIC* mg) {
if (SvTRUE(sv)) {
s_pref_int = 1;
} else {
@ -85,7 +85,7 @@ void boot_Data__MessagePack_pack(void) {
}
static int try_int(enc_t* enc, const char *p, size_t len) {
STATIC_INLINE int try_int(enc_t* enc, const char *p, size_t len) {
int negative = 0;
const char* pe = p + len;
uint64_t num = 0;
@ -141,7 +141,7 @@ static int try_int(enc_t* enc, const char *p, size_t len) {
static void _msgpack_pack_rv(enc_t *enc, SV* sv, int depth);
static void _msgpack_pack_sv(enc_t *enc, SV* sv, int depth) {
STATIC_INLINE void _msgpack_pack_sv(enc_t *enc, SV* sv, int depth) {
if (depth <= 0) Perl_croak(aTHX_ ERR_NESTING_EXCEEDED);
SvGETMAGIC(sv);
@ -176,7 +176,7 @@ static void _msgpack_pack_sv(enc_t *enc, SV* sv, int depth) {
}
}
static void _msgpack_pack_rv(enc_t *enc, SV* sv, int depth) {
STATIC_INLINE void _msgpack_pack_rv(enc_t *enc, SV* sv, int depth) {
svtype svt;
if (depth <= 0) Perl_croak(aTHX_ ERR_NESTING_EXCEEDED);
SvGETMAGIC(sv);