summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-07-18 14:51:37 (GMT)
committerGuido van Rossum <guido@python.org>1995-07-18 14:51:37 (GMT)
commit681d79aaf397850778608f35585d091fa7fe370a (patch)
tree3d45bd9b84777931bba732abd1dbba484e2a64c1 /Python/marshal.c
parent11a3f0c2bca1a8fdea396b989559f25fbc6fe65e (diff)
downloadcpython-681d79aaf397850778608f35585d091fa7fe370a.zip
cpython-681d79aaf397850778608f35585d091fa7fe370a.tar.gz
cpython-681d79aaf397850778608f35585d091fa7fe370a.tar.bz2
keyword arguments and faster calls
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 8c01020..05265f5 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -44,7 +44,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define TYPE_TUPLE '('
#define TYPE_LIST '['
#define TYPE_DICT '{'
-#define TYPE_CODE 'C'
+#define TYPE_CODE 'c'
#define TYPE_UNKNOWN '?'
typedef struct {
@@ -187,9 +187,13 @@ w_object(v, p)
else if (is_codeobject(v)) {
codeobject *co = (codeobject *)v;
w_byte(TYPE_CODE, p);
+ w_short(co->co_argcount, p);
+ w_short(co->co_nlocals, p);
+ w_short(co->co_flags, p);
w_object((object *)co->co_code, p);
w_object(co->co_consts, p);
w_object(co->co_names, p);
+ w_object(co->co_varnames, p);
w_object(co->co_filename, p);
w_object(co->co_name, p);
}
@@ -374,14 +378,20 @@ r_object(p)
case TYPE_CODE:
{
+ int argcount = r_short(p);
+ int nlocals = r_short(p);
+ int flags = r_short(p);
object *code = r_object(p);
object *consts = r_object(p);
object *names = r_object(p);
+ object *varnames = r_object(p);
object *filename = r_object(p);
object *name = r_object(p);
if (!err_occurred()) {
- v = (object *) newcodeobject(code,
- consts, names, filename, name);
+ v = (object *) newcodeobject(
+ argcount, nlocals, flags,
+ code, consts, names, varnames,
+ filename, name);
}
else
v = NULL;