mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-21 15:10:01 +01:00
perl: inlining the small functions
This commit is contained in:
parent
0cd31a4b96
commit
0c4f0de13d
@ -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?)"
|
#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) {
|
if (enc->cur + len >= enc->end) {
|
||||||
STRLEN cur = enc->cur - (char *)SvPVX (enc->sv);
|
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 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)) {
|
if (SvTRUE(sv)) {
|
||||||
s_pref_int = 1;
|
s_pref_int = 1;
|
||||||
} else {
|
} 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;
|
int negative = 0;
|
||||||
const char* pe = p + len;
|
const char* pe = p + len;
|
||||||
uint64_t num = 0;
|
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_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);
|
if (depth <= 0) Perl_croak(aTHX_ ERR_NESTING_EXCEEDED);
|
||||||
SvGETMAGIC(sv);
|
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;
|
svtype svt;
|
||||||
if (depth <= 0) Perl_croak(aTHX_ ERR_NESTING_EXCEEDED);
|
if (depth <= 0) Perl_croak(aTHX_ ERR_NESTING_EXCEEDED);
|
||||||
SvGETMAGIC(sv);
|
SvGETMAGIC(sv);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user