Mercurial > emacs
comparison src/alloc.c @ 83632:cc587bfd19ca
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--multi-tty--0--patch-21
| author | Miles Bader <miles@gnu.org> |
|---|---|
| date | Mon, 11 Jun 2007 01:00:07 +0000 |
| parents | dc002877ce12 1842d7137ff2 |
| children | 0ece58f6e0aa |
comparison
equal
deleted
inserted
replaced
| 83631:7d63b897231b | 83632:cc587bfd19ca |
|---|---|
| 1757 total_strings = total_free_strings = total_string_size = 0; | 1757 total_strings = total_free_strings = total_string_size = 0; |
| 1758 oldest_sblock = current_sblock = large_sblocks = NULL; | 1758 oldest_sblock = current_sblock = large_sblocks = NULL; |
| 1759 string_blocks = NULL; | 1759 string_blocks = NULL; |
| 1760 n_string_blocks = 0; | 1760 n_string_blocks = 0; |
| 1761 string_free_list = NULL; | 1761 string_free_list = NULL; |
| 1762 empty_unibyte_string = make_pure_string ("", 0, 0, 0); | |
| 1763 empty_multibyte_string = make_pure_string ("", 0, 0, 1); | |
| 1762 } | 1764 } |
| 1763 | 1765 |
| 1764 | 1766 |
| 1765 #ifdef GC_CHECK_STRING_BYTES | 1767 #ifdef GC_CHECK_STRING_BYTES |
| 1766 | 1768 |
| 2480 Lisp_Object | 2482 Lisp_Object |
| 2481 make_uninit_string (length) | 2483 make_uninit_string (length) |
| 2482 int length; | 2484 int length; |
| 2483 { | 2485 { |
| 2484 Lisp_Object val; | 2486 Lisp_Object val; |
| 2487 | |
| 2488 if (!length) | |
| 2489 return empty_unibyte_string; | |
| 2485 val = make_uninit_multibyte_string (length, length); | 2490 val = make_uninit_multibyte_string (length, length); |
| 2486 STRING_SET_UNIBYTE (val); | 2491 STRING_SET_UNIBYTE (val); |
| 2487 return val; | 2492 return val; |
| 2488 } | 2493 } |
| 2489 | 2494 |
| 2498 Lisp_Object string; | 2503 Lisp_Object string; |
| 2499 struct Lisp_String *s; | 2504 struct Lisp_String *s; |
| 2500 | 2505 |
| 2501 if (nchars < 0) | 2506 if (nchars < 0) |
| 2502 abort (); | 2507 abort (); |
| 2508 if (!nbytes) | |
| 2509 return empty_multibyte_string; | |
| 2503 | 2510 |
| 2504 s = allocate_string (); | 2511 s = allocate_string (); |
| 2505 allocate_string_data (s, nchars, nbytes); | 2512 allocate_string_data (s, nchars, nbytes); |
| 2506 XSETSTRING (string, s); | 2513 XSETSTRING (string, s); |
| 2507 string_chars_consed += nbytes; | 2514 string_chars_consed += nbytes; |
