Optimize and refactor printing of numbers to buffers.

This commit is contained in:
Mike Pall
2013-03-25 16:41:13 +01:00
parent 3b0b3afbb1
commit 59329cfbbf
5 changed files with 70 additions and 63 deletions

View File

@@ -20,8 +20,9 @@ LJ_FUNC void LJ_FASTCALL lj_str_free(global_State *g, GCstr *s);
#define lj_str_newlit(L, s) (lj_str_new(L, "" s, sizeof(s)-1))
/* Type conversions. */
LJ_FUNC MSize LJ_FASTCALL lj_str_bufnum(char *s, cTValue *o);
LJ_FUNC MSize LJ_FASTCALL lj_str_bufptr(char *p, const void *v);
LJ_FUNC char * LJ_FASTCALL lj_str_bufint(char *buf, int32_t k);
LJ_FUNC char * LJ_FASTCALL lj_str_bufnum(char *p, cTValue *o);
LJ_FUNC char * LJ_FASTCALL lj_str_bufptr(char *p, const void *v);
LJ_FUNC const char *lj_str_buftv(char *buf, cTValue *o, MSize *lenp);
LJ_FUNCA GCstr * LJ_FASTCALL lj_str_fromnum(lua_State *L, const lua_Number *np);
LJ_FUNC GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k);