Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
233f3db6
Commit
233f3db6
authored
Oct 26, 2004
by
Kim F. Storm
Browse files
Fix SAFE_FREE calls. Replace SAFE_FREE_LISP calls.
parent
e65837df
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
17 deletions
+28
-17
src/ChangeLog
src/ChangeLog
+11
-0
src/casefiddle.c
src/casefiddle.c
+1
-1
src/charset.c
src/charset.c
+1
-1
src/data.c
src/data.c
+2
-2
src/fns.c
src/fns.c
+12
-12
src/xdisp.c
src/xdisp.c
+1
-1
No files found.
src/ChangeLog
View file @
233f3db6
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,Ad(Brv <jan.h.d@swipnet.se>
* gtkutil.c: Put empty line between comment and function body.
...
...
src/casefiddle.c
View file @
233f3db6
...
...
@@ -137,7 +137,7 @@ casify_object (flag, obj)
}
obj
=
make_multibyte_string
(
buf
,
SCHARS
(
obj
),
j_byte
);
SAFE_FREE
(
bufsize
);
SAFE_FREE
();
}
return
obj
;
}
...
...
src/charset.c
View file @
233f3db6
...
...
@@ -1673,7 +1673,7 @@ usage: (string &rest CHARACTERS) */)
}
ret
=
make_string_from_bytes
(
buf
,
n
,
p
-
buf
);
SAFE_FREE
(
bufsize
);
SAFE_FREE
();
return
ret
;
}
...
...
src/data.c
View file @
233f3db6
...
...
@@ -2165,7 +2165,7 @@ bool-vector. IDX starts at 0. */)
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
--
)
...
...
@@ -2206,7 +2206,7 @@ bool-vector. IDX starts at 0. */)
*
p1
++
=
*
p0
++
;
bcopy
(
str
+
idxval_byte
+
prev_bytes
,
p1
,
nbytes
-
(
idxval_byte
+
prev_bytes
));
SAFE_FREE
(
nbytes
);
SAFE_FREE
();
clear_string_char_byte_cache
();
}
}
...
...
src/fns.c
View file @
233f3db6
...
...
@@ -1012,7 +1012,7 @@ string_make_multibyte (string)
0
,
1
);
ret
=
make_multibyte_string
(
buf
,
SCHARS
(
string
),
nbytes
);
SAFE_FREE
(
nbytes
);
SAFE_FREE
();
return
ret
;
}
...
...
@@ -1046,7 +1046,7 @@ string_to_multibyte (string)
str_to_multibyte
(
buf
,
nbytes
,
SBYTES
(
string
));
ret
=
make_multibyte_string
(
buf
,
SCHARS
(
string
),
nbytes
);
SAFE_FREE
(
nbytes
);
SAFE_FREE
();
return
ret
;
}
...
...
@@ -1073,7 +1073,7 @@ string_make_unibyte (string)
1
,
0
);
ret
=
make_unibyte_string
(
buf
,
nchars
);
SAFE_FREE
(
nchars
);
SAFE_FREE
();
return
ret
;
}
...
...
@@ -3030,7 +3030,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
args
[
i
]
=
separator
;
ret
=
Fconcat
(
nargs
,
args
);
SAFE_FREE
_LISP
(
nargs
);
SAFE_FREE
(
);
return
ret
;
}
...
...
@@ -3056,7 +3056,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
mapcar1
(
leni
,
args
,
function
,
sequence
);
ret
=
Flist
(
leni
,
args
);
SAFE_FREE
_LISP
(
leni
);
SAFE_FREE
(
);
return
ret
;
}
...
...
@@ -3763,7 +3763,7 @@ into shorter lines. */)
if
(
encoded_length
<
0
)
{
/* The encoding wasn't possible. */
SAFE_FREE
(
allength
);
SAFE_FREE
();
error
(
"Multibyte character in data for base64 encoding"
);
}
...
...
@@ -3771,7 +3771,7 @@ into shorter lines. */)
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
...
...
@@ -3820,12 +3820,12 @@ into shorter lines. */)
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
;
}
...
...
@@ -3962,7 +3962,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
if
(
decoded_length
<
0
)
{
/* The decoding wasn't possible. */
SAFE_FREE
(
allength
);
SAFE_FREE
();
error
(
"Invalid base64 data"
);
}
...
...
@@ -3970,7 +3970,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
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
,
...
...
@@ -4014,7 +4014,7 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string,
else
decoded_string
=
Qnil
;
SAFE_FREE
(
length
);
SAFE_FREE
();
if
(
!
STRINGP
(
decoded_string
))
error
(
"Invalid base64 data"
);
...
...
src/xdisp.c
View file @
233f3db6
...
...
@@ -6365,7 +6365,7 @@ add_to_log (format, arg1, arg2)
bcopy (SDATA (msg), buffer, len);
message_dolog (buffer, len - 1, 1, 0);
SAFE_FREE (
len
);
SAFE_FREE ();
UNGCPRO;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment