Mercurial > emacs
comparison src/alloc.c @ 90918:e9f94688a064
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 781-792)
- Update from CVS
- Merge from gnus--rel--5.10
- Merge from emacs--rel--22
* emacs--rel--22 (patch 33-41)
* gnus--rel--5.10 (patch 226-228)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-219
| author | Miles Bader <miles@gnu.org> |
|---|---|
| date | Mon, 11 Jun 2007 00:58:11 +0000 |
| parents | e6fdae9180d4 1842d7137ff2 |
| children | 3371fc48749b |
comparison
equal
deleted
inserted
replaced
| 90917:9f1c3e957d3e | 90918:e9f94688a064 |
|---|---|
| 1754 total_strings = total_free_strings = total_string_size = 0; | 1754 total_strings = total_free_strings = total_string_size = 0; |
| 1755 oldest_sblock = current_sblock = large_sblocks = NULL; | 1755 oldest_sblock = current_sblock = large_sblocks = NULL; |
| 1756 string_blocks = NULL; | 1756 string_blocks = NULL; |
| 1757 n_string_blocks = 0; | 1757 n_string_blocks = 0; |
| 1758 string_free_list = NULL; | 1758 string_free_list = NULL; |
| 1759 empty_unibyte_string = make_pure_string ("", 0, 0, 0); | |
| 1760 empty_multibyte_string = make_pure_string ("", 0, 0, 1); | |
| 1759 } | 1761 } |
| 1760 | 1762 |
| 1761 | 1763 |
| 1762 #ifdef GC_CHECK_STRING_BYTES | 1764 #ifdef GC_CHECK_STRING_BYTES |
| 1763 | 1765 |
| 2477 Lisp_Object | 2479 Lisp_Object |
| 2478 make_uninit_string (length) | 2480 make_uninit_string (length) |
| 2479 int length; | 2481 int length; |
| 2480 { | 2482 { |
| 2481 Lisp_Object val; | 2483 Lisp_Object val; |
| 2484 | |
| 2485 if (!length) | |
| 2486 return empty_unibyte_string; | |
| 2482 val = make_uninit_multibyte_string (length, length); | 2487 val = make_uninit_multibyte_string (length, length); |
| 2483 STRING_SET_UNIBYTE (val); | 2488 STRING_SET_UNIBYTE (val); |
| 2484 return val; | 2489 return val; |
| 2485 } | 2490 } |
| 2486 | 2491 |
| 2495 Lisp_Object string; | 2500 Lisp_Object string; |
| 2496 struct Lisp_String *s; | 2501 struct Lisp_String *s; |
| 2497 | 2502 |
| 2498 if (nchars < 0) | 2503 if (nchars < 0) |
| 2499 abort (); | 2504 abort (); |
| 2505 if (!nbytes) | |
| 2506 return empty_multibyte_string; | |
| 2500 | 2507 |
| 2501 s = allocate_string (); | 2508 s = allocate_string (); |
| 2502 allocate_string_data (s, nchars, nbytes); | 2509 allocate_string_data (s, nchars, nbytes); |
| 2503 XSETSTRING (string, s); | 2510 XSETSTRING (string, s); |
| 2504 string_chars_consed += nbytes; | 2511 string_chars_consed += nbytes; |
