aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2004-10-26 22:38:50 +0000
committerKim F. Storm2004-10-26 22:38:50 +0000
commit233f3db624556da41f0edb0c0a03dc4288eeea98 (patch)
tree929dc6d80200504a57102e8e289864cebc083f79 /src
parente65837df545fcf0791b3c8db27186e605cf89538 (diff)
downloademacs-233f3db624556da41f0edb0c0a03dc4288eeea98.tar.gz
emacs-233f3db624556da41f0edb0c0a03dc4288eeea98.zip
Fix SAFE_FREE calls. Replace SAFE_FREE_LISP calls.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/casefiddle.c2
-rw-r--r--src/charset.c2
-rw-r--r--src/data.c4
-rw-r--r--src/fns.c24
-rw-r--r--src/xdisp.c2
6 files changed, 28 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 150bc439979..fbef104296f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12004-10-27 Kim F. Storm <storm@cua.dk>
2
3 * editfns.c (Fformat): Allocate discarded table with SAFE_ALLOCA.
4 Only allocate info and discarded tables once.
5
6 * lisp.h (USE_SAFE_ALLOCA): Add and init sa_must_free integer.
7 (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Increment it when malloc is used.
8 (SAFE_FREE): Test it to determine if we need to unwind to free.
9 Remove size arg. All users changed.
10 (SAFE_FREE_LISP) Remove. All users changed to use SAFE_FREE.
11
12004-10-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 122004-10-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 13
3 * gtkutil.c: Put empty line between comment and function body. 14 * gtkutil.c: Put empty line between comment and function body.
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 25a5a3d12b8..51fc6444f49 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -137,7 +137,7 @@ casify_object (flag, obj)
137 } 137 }
138 obj = make_multibyte_string (buf, SCHARS (obj), 138 obj = make_multibyte_string (buf, SCHARS (obj),
139 j_byte); 139 j_byte);
140 SAFE_FREE (bufsize); 140 SAFE_FREE ();
141 } 141 }
142 return obj; 142 return obj;
143 } 143 }
diff --git a/src/charset.c b/src/charset.c
index 8eeddd51c92..c03107a9c46 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1673,7 +1673,7 @@ usage: (string &rest CHARACTERS) */)
1673 } 1673 }
1674 1674
1675 ret = make_string_from_bytes (buf, n, p - buf); 1675 ret = make_string_from_bytes (buf, n, p - buf);
1676 SAFE_FREE (bufsize); 1676 SAFE_FREE ();
1677 1677
1678 return ret; 1678 return ret;
1679} 1679}
diff --git a/src/data.c b/src/data.c
index 33b37376a49..92487f82ddb 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2165,7 +2165,7 @@ bool-vector. IDX starts at 0. */)
2165 p1 = SDATA (array) + idxval_byte; 2165 p1 = SDATA (array) + idxval_byte;
2166 bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes, 2166 bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes,
2167 nbytes - (idxval_byte + prev_bytes)); 2167 nbytes - (idxval_byte + prev_bytes));
2168 SAFE_FREE (nbytes); 2168 SAFE_FREE ();
2169 clear_string_char_byte_cache (); 2169 clear_string_char_byte_cache ();
2170 } 2170 }
2171 while (new_bytes--) 2171 while (new_bytes--)
@@ -2206,7 +2206,7 @@ bool-vector. IDX starts at 0. */)
2206 *p1++ = *p0++; 2206 *p1++ = *p0++;
2207 bcopy (str + idxval_byte + prev_bytes, p1, 2207 bcopy (str + idxval_byte + prev_bytes, p1,
2208 nbytes - (idxval_byte + prev_bytes)); 2208 nbytes - (idxval_byte + prev_bytes));
2209 SAFE_FREE (nbytes); 2209 SAFE_FREE ();
2210 clear_string_char_byte_cache (); 2210 clear_string_char_byte_cache ();
2211 } 2211 }
2212 } 2212 }
diff --git a/src/fns.c b/src/fns.c
index 814babae7d8..b366cab196a 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1012,7 +1012,7 @@ string_make_multibyte (string)
1012 0, 1); 1012 0, 1);
1013 1013
1014 ret = make_multibyte_string (buf, SCHARS (string), nbytes); 1014 ret = make_multibyte_string (buf, SCHARS (string), nbytes);
1015 SAFE_FREE (nbytes); 1015 SAFE_FREE ();
1016 1016
1017 return ret; 1017 return ret;
1018} 1018}
@@ -1046,7 +1046,7 @@ string_to_multibyte (string)
1046 str_to_multibyte (buf, nbytes, SBYTES (string)); 1046 str_to_multibyte (buf, nbytes, SBYTES (string));
1047 1047
1048 ret = make_multibyte_string (buf, SCHARS (string), nbytes); 1048 ret = make_multibyte_string (buf, SCHARS (string), nbytes);
1049 SAFE_FREE (nbytes); 1049 SAFE_FREE ();
1050 1050
1051 return ret; 1051 return ret;
1052} 1052}
@@ -1073,7 +1073,7 @@ string_make_unibyte (string)
1073 1, 0); 1073 1, 0);
1074 1074
1075 ret = make_unibyte_string (buf, nchars); 1075 ret = make_unibyte_string (buf, nchars);
1076 SAFE_FREE (nchars); 1076 SAFE_FREE ();
1077 1077
1078 return ret; 1078 return ret;
1079} 1079}
@@ -3030,7 +3030,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
3030 args[i] = separator; 3030 args[i] = separator;
3031 3031
3032 ret = Fconcat (nargs, args); 3032 ret = Fconcat (nargs, args);
3033 SAFE_FREE_LISP (nargs); 3033 SAFE_FREE ();
3034 3034
3035 return ret; 3035 return ret;
3036} 3036}
@@ -3056,7 +3056,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
3056 mapcar1 (leni, args, function, sequence); 3056 mapcar1 (leni, args, function, sequence);
3057 3057
3058 ret = Flist (leni, args); 3058 ret = Flist (leni, args);
3059 SAFE_FREE_LISP (leni); 3059 SAFE_FREE ();
3060 3060
3061 return ret; 3061 return ret;
3062} 3062}
@@ -3763,7 +3763,7 @@ into shorter lines. */)
3763 if (encoded_length < 0) 3763 if (encoded_length < 0)
3764 { 3764 {
3765 /* The encoding wasn't possible. */ 3765 /* The encoding wasn't possible. */
3766 SAFE_FREE (allength); 3766 SAFE_FREE ();
3767 error ("Multibyte character in data for base64 encoding"); 3767 error ("Multibyte character in data for base64 encoding");
3768 } 3768 }
3769 3769
@@ -3771,7 +3771,7 @@ into shorter lines. */)
3771 and delete the old. (Insert first in order to preserve markers.) */ 3771 and delete the old. (Insert first in order to preserve markers.) */
3772 SET_PT_BOTH (XFASTINT (beg), ibeg); 3772 SET_PT_BOTH (XFASTINT (beg), ibeg);
3773 insert (encoded, encoded_length); 3773 insert (encoded, encoded_length);
3774 SAFE_FREE (allength); 3774 SAFE_FREE ();
3775 del_range_byte (ibeg + encoded_length, iend + encoded_length, 1); 3775 del_range_byte (ibeg + encoded_length, iend + encoded_length, 1);
3776 3776
3777 /* If point was outside of the region, restore it exactly; else just 3777 /* If point was outside of the region, restore it exactly; else just
@@ -3820,12 +3820,12 @@ into shorter lines. */)
3820 if (encoded_length < 0) 3820 if (encoded_length < 0)
3821 { 3821 {
3822 /* The encoding wasn't possible. */ 3822 /* The encoding wasn't possible. */
3823 SAFE_FREE (allength); 3823 SAFE_FREE ();
3824 error ("Multibyte character in data for base64 encoding"); 3824 error ("Multibyte character in data for base64 encoding");
3825 } 3825 }
3826 3826
3827 encoded_string = make_unibyte_string (encoded, encoded_length); 3827 encoded_string = make_unibyte_string (encoded, encoded_length);
3828 SAFE_FREE (allength); 3828 SAFE_FREE ();
3829 3829
3830 return encoded_string; 3830 return encoded_string;
3831} 3831}
@@ -3962,7 +3962,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
3962 if (decoded_length < 0) 3962 if (decoded_length < 0)
3963 { 3963 {
3964 /* The decoding wasn't possible. */ 3964 /* The decoding wasn't possible. */
3965 SAFE_FREE (allength); 3965 SAFE_FREE ();
3966 error ("Invalid base64 data"); 3966 error ("Invalid base64 data");
3967 } 3967 }
3968 3968
@@ -3970,7 +3970,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
3970 and delete the old. (Insert first in order to preserve markers.) */ 3970 and delete the old. (Insert first in order to preserve markers.) */
3971 TEMP_SET_PT_BOTH (XFASTINT (beg), ibeg); 3971 TEMP_SET_PT_BOTH (XFASTINT (beg), ibeg);
3972 insert_1_both (decoded, inserted_chars, decoded_length, 0, 1, 0); 3972 insert_1_both (decoded, inserted_chars, decoded_length, 0, 1, 0);
3973 SAFE_FREE (allength); 3973 SAFE_FREE ();
3974 3974
3975 /* Delete the original text. */ 3975 /* Delete the original text. */
3976 del_range_both (PT, PT_BYTE, XFASTINT (end) + inserted_chars, 3976 del_range_both (PT, PT_BYTE, XFASTINT (end) + inserted_chars,
@@ -4014,7 +4014,7 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string,
4014 else 4014 else
4015 decoded_string = Qnil; 4015 decoded_string = Qnil;
4016 4016
4017 SAFE_FREE (length); 4017 SAFE_FREE ();
4018 if (!STRINGP (decoded_string)) 4018 if (!STRINGP (decoded_string))
4019 error ("Invalid base64 data"); 4019 error ("Invalid base64 data");
4020 4020
diff --git a/src/xdisp.c b/src/xdisp.c
index 306e26702f5..afae7fd22af 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6365,7 +6365,7 @@ add_to_log (format, arg1, arg2)
6365 bcopy (SDATA (msg), buffer, len); 6365 bcopy (SDATA (msg), buffer, len);
6366 6366
6367 message_dolog (buffer, len - 1, 1, 0); 6367 message_dolog (buffer, len - 1, 1, 0);
6368 SAFE_FREE (len); 6368 SAFE_FREE ();
6369 6369
6370 UNGCPRO; 6370 UNGCPRO;
6371} 6371}