Add v7 arg to _mk_ and _get_ functions

`v7_mk_undefined()` and `v7_mk_null()` are left unchanged, but marked
deprecated, and `V7_UNDEFINED` and `V7_NULL` are public now.

Xtensa code size with instrumentation: 590400 -> 590432, i.e. 32 bytes.
Xtensa code size without instrumentation: 530848 -> 531760, i.e. 912
bytes.

As objdump reveals, inside v7.c, `v7_mk_number` and others are inlined,
so the extra v7 argument is eliminated; outside of v7.c it's obviously
not inlined.

----

Also, v7_get_int() is added, which currently just casts stored double
value to int

PUBLISHED_FROM=e984b7308faf2380b3de388f238e0fae0aea545d
This commit is contained in:
Dmitry Frank authored and Sergey Lyubka committed 2016-05-28 18:59:27 +01:00
1 parent b5b672ec89
commit 177e829f4b
3 files changed
+10 -9

No files matched your search

+4 -5
View File
@@ -1,11 +1,10 @@
---
title: "mg_mk_str()"
decl_name: "mg_mk_str"
title: "MG_MK_STR()"
decl_name: "MG_MK_STR"
symbol_kind: "func"
signature: |
struct mg_str mg_mk_str(const char *s);
#define MG_MK_STR(str_literal);
---
A helper function for creating mg_str struct from plain C string.
`NULL` is allowed and becomes `{NULL, 0}`.
Macro for initializing mg_str.