Commit 8eb61e52 authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

* alloc.c (mark_overlay): Assume that overlay boundaries are

always markers.  Add comment.
* lread.c (read_internal_start): Use convenient validate_subarray.
Adjust docstring.
(Fread_from_string): Adjust docstring.
parent 1c142556
2014-10-02 Dmitry Antipov <dmantipov@yandex.ru>
* alloc.c (mark_overlay): Assume that overlay boundaries are
always markers. Add comment.
* lread.c (read_internal_start): Use convenient validate_subarray.
Adjust docstring.
(Fread_from_string): Adjust docstring.
2014-10-02 Stefan Monnier <monnier@iro.umontreal.ca> 2014-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
   
* lisp.h: Fix up compilation for USE_STACK_LISP_OBJECTS=false. * lisp.h: Fix up compilation for USE_STACK_LISP_OBJECTS=false.
......
...@@ -6015,8 +6015,9 @@ mark_overlay (struct Lisp_Overlay *ptr) ...@@ -6015,8 +6015,9 @@ mark_overlay (struct Lisp_Overlay *ptr)
for (; ptr && !ptr->gcmarkbit; ptr = ptr->next) for (; ptr && !ptr->gcmarkbit; ptr = ptr->next)
{ {
ptr->gcmarkbit = 1; ptr->gcmarkbit = 1;
mark_object (ptr->start); /* These two are always markers and can be marked fast. */
mark_object (ptr->end); XMARKER (ptr->start)->gcmarkbit = 1;
XMARKER (ptr->end)->gcmarkbit = 1;
mark_object (ptr->plist); mark_object (ptr->plist);
} }
} }
......
...@@ -2096,9 +2096,10 @@ DEFUN ("read-from-string", Fread_from_string, Sread_from_string, 1, 3, 0, ...@@ -2096,9 +2096,10 @@ DEFUN ("read-from-string", Fread_from_string, Sread_from_string, 1, 3, 0,
doc: /* Read one Lisp expression which is represented as text by STRING. doc: /* Read one Lisp expression which is represented as text by STRING.
Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX). Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX).
FINAL-STRING-INDEX is an integer giving the position of the next FINAL-STRING-INDEX is an integer giving the position of the next
remaining character in STRING. remaining character in STRING. START and END optionally delimit
START and END optionally delimit a substring of STRING from which to read; a substring of STRING from which to read; they default to 0 and
they default to 0 and (length STRING) respectively. */) (length STRING) respectively. Negative values are counted from
the end of STRING. */)
(Lisp_Object string, Lisp_Object start, Lisp_Object end) (Lisp_Object string, Lisp_Object start, Lisp_Object end)
{ {
Lisp_Object ret; Lisp_Object ret;
...@@ -2109,10 +2110,9 @@ START and END optionally delimit a substring of STRING from which to read; ...@@ -2109,10 +2110,9 @@ START and END optionally delimit a substring of STRING from which to read;
} }
/* Function to set up the global context we need in toplevel read /* Function to set up the global context we need in toplevel read
calls. */ calls. START and END only used when STREAM is a string. */
static Lisp_Object static Lisp_Object
read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end) read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end)
/* `start', `end' only used when stream is a string. */
{ {
Lisp_Object retval; Lisp_Object retval;
...@@ -2134,25 +2134,9 @@ read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end) ...@@ -2134,25 +2134,9 @@ read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end)
else else
string = XCAR (stream); string = XCAR (stream);
if (NILP (end)) validate_subarray (string, start, end, SCHARS (string),
endval = SCHARS (string); &startval, &endval);
else
{
CHECK_NUMBER (end);
if (! (0 <= XINT (end) && XINT (end) <= SCHARS (string)))
args_out_of_range (string, end);
endval = XINT (end);
}
if (NILP (start))
startval = 0;
else
{
CHECK_NUMBER (start);
if (! (0 <= XINT (start) && XINT (start) <= endval))
args_out_of_range (string, start);
startval = XINT (start);
}
read_from_string_index = startval; read_from_string_index = startval;
read_from_string_index_byte = string_char_to_byte (string, startval); read_from_string_index_byte = string_char_to_byte (string, startval);
read_from_string_limit = endval; read_from_string_limit = endval;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment