+2004-10-27 Kim F. Storm <storm@cua.dk>
+
+ * editfns.c (Fformat): Allocate discarded table with SAFE_ALLOCA.
+ Only allocate info and discarded tables once.
+
+ * lisp.h (USE_SAFE_ALLOCA): Add and init sa_must_free integer.
+ (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Increment it when malloc is used.
+ (SAFE_FREE): Test it to determine if we need to unwind to free.
+ Remove size arg. All users changed.
+ (SAFE_FREE_LISP) Remove. All users changed to use SAFE_FREE.
+
2004-10-26 Jan Dj\e,Ad\e(Brv <jan.h.d@swipnet.se>
* gtkutil.c: Put empty line between comment and function body.
p1 = SDATA (array) + idxval_byte;
bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes,
nbytes - (idxval_byte + prev_bytes));
- SAFE_FREE (nbytes);
+ SAFE_FREE ();
clear_string_char_byte_cache ();
}
while (new_bytes--)
*p1++ = *p0++;
bcopy (str + idxval_byte + prev_bytes, p1,
nbytes - (idxval_byte + prev_bytes));
- SAFE_FREE (nbytes);
+ SAFE_FREE ();
clear_string_char_byte_cache ();
}
}
0, 1);
ret = make_multibyte_string (buf, SCHARS (string), nbytes);
- SAFE_FREE (nbytes);
+ SAFE_FREE ();
return ret;
}
str_to_multibyte (buf, nbytes, SBYTES (string));
ret = make_multibyte_string (buf, SCHARS (string), nbytes);
- SAFE_FREE (nbytes);
+ SAFE_FREE ();
return ret;
}
1, 0);
ret = make_unibyte_string (buf, nchars);
- SAFE_FREE (nchars);
+ SAFE_FREE ();
return ret;
}
args[i] = separator;
ret = Fconcat (nargs, args);
- SAFE_FREE_LISP (nargs);
+ SAFE_FREE ();
return ret;
}
mapcar1 (leni, args, function, sequence);
ret = Flist (leni, args);
- SAFE_FREE_LISP (leni);
+ SAFE_FREE ();
return ret;
}
if (encoded_length < 0)
{
/* The encoding wasn't possible. */
- SAFE_FREE (allength);
+ SAFE_FREE ();
error ("Multibyte character in data for base64 encoding");
}
and delete the old. (Insert first in order to preserve markers.) */
SET_PT_BOTH (XFASTINT (beg), ibeg);
insert (encoded, encoded_length);
- SAFE_FREE (allength);
+ SAFE_FREE ();
del_range_byte (ibeg + encoded_length, iend + encoded_length, 1);
/* If point was outside of the region, restore it exactly; else just
if (encoded_length < 0)
{
/* The encoding wasn't possible. */
- SAFE_FREE (allength);
+ SAFE_FREE ();
error ("Multibyte character in data for base64 encoding");
}
encoded_string = make_unibyte_string (encoded, encoded_length);
- SAFE_FREE (allength);
+ SAFE_FREE ();
return encoded_string;
}
if (decoded_length < 0)
{
/* The decoding wasn't possible. */
- SAFE_FREE (allength);
+ SAFE_FREE ();
error ("Invalid base64 data");
}
and delete the old. (Insert first in order to preserve markers.) */
TEMP_SET_PT_BOTH (XFASTINT (beg), ibeg);
insert_1_both (decoded, inserted_chars, decoded_length, 0, 1, 0);
- SAFE_FREE (allength);
+ SAFE_FREE ();
/* Delete the original text. */
del_range_both (PT, PT_BYTE, XFASTINT (end) + inserted_chars,
else
decoded_string = Qnil;
- SAFE_FREE (length);
+ SAFE_FREE ();
if (!STRINGP (decoded_string))
error ("Invalid base64 data");