Mercurial > hg > xemacs-beta
comparison src/alloc.c @ 945:7924b28c57a4
[xemacs-hg @ 2002-08-01 08:38:32 by michaels]
2002-07-31 Didier Verna <didier@xemacs.org>
* file-coding.c (make_coding_system_1): Add missing call to
`xfree (newname)'.
* fix memory leak introduced by
2002-04-14 Ben Wing <ben@xemacs.org>:
alloc.c (Fmake_byte_code): don't xnew_array of size 0.
(sweep_compiled_functions): define ADDITIONAL_FREE_compiled_function
to free the args field when needed.
author | michaels |
---|---|
date | Thu, 01 Aug 2002 08:38:48 +0000 |
parents | 345b7d75cab4 |
children | 25e260cb7994 |
comparison
equal
deleted
inserted
replaced
944:d7603d225813 | 945:7924b28c57a4 |
---|---|
1535 totalargs++; | 1535 totalargs++; |
1536 } | 1536 } |
1537 } | 1537 } |
1538 } | 1538 } |
1539 | 1539 |
1540 f->args = xnew_array (Lisp_Object, totalargs); | 1540 if (totalargs) |
1541 f->args = xnew_array (Lisp_Object, totalargs); | |
1541 | 1542 |
1542 { | 1543 { |
1543 LIST_LOOP_2 (arg, arglist) | 1544 LIST_LOOP_2 (arg, arglist) |
1544 { | 1545 { |
1545 if (!EQ (arg, Qand_optional) && !EQ (arg, Qand_rest)) | 1546 if (!EQ (arg, Qand_optional) && !EQ (arg, Qand_rest)) |
3619 | 3620 |
3620 static void | 3621 static void |
3621 sweep_compiled_functions (void) | 3622 sweep_compiled_functions (void) |
3622 { | 3623 { |
3623 #define UNMARK_compiled_function(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) | 3624 #define UNMARK_compiled_function(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) |
3624 #define ADDITIONAL_FREE_compiled_function(ptr) | 3625 #define ADDITIONAL_FREE_compiled_function(ptr) \ |
3626 if (ptr->args_in_array) xfree (ptr->args) | |
3625 | 3627 |
3626 SWEEP_FIXED_TYPE_BLOCK (compiled_function, Lisp_Compiled_Function); | 3628 SWEEP_FIXED_TYPE_BLOCK (compiled_function, Lisp_Compiled_Function); |
3627 } | 3629 } |
3628 | 3630 |
3629 | 3631 |