Mercurial > emacs
comparison src/coding.c @ 56191:75f56340b4f9
(MAX_ALLOCA): Remove define.
| author | Kim F. Storm <storm@cua.dk> |
|---|---|
| date | Mon, 21 Jun 2004 21:53:27 +0000 |
| parents | 32381d1c4eab |
| children | 40a0843be50a dbcd0af66869 |
comparison
equal
deleted
inserted
replaced
| 56190:f7711455b84f | 56191:75f56340b4f9 |
|---|---|
| 2096 We keep these bytes as is for the moment. | 2096 We keep these bytes as is for the moment. |
| 2097 They may be decoded by post-read-conversion. */ | 2097 They may be decoded by post-read-conversion. */ |
| 2098 int dim, M, L; | 2098 int dim, M, L; |
| 2099 int size, required; | 2099 int size, required; |
| 2100 int produced_chars; | 2100 int produced_chars; |
| 2101 | 2101 |
| 2102 ONE_MORE_BYTE (dim); | 2102 ONE_MORE_BYTE (dim); |
| 2103 ONE_MORE_BYTE (M); | 2103 ONE_MORE_BYTE (M); |
| 2104 ONE_MORE_BYTE (L); | 2104 ONE_MORE_BYTE (L); |
| 2105 size = ((M - 128) * 128) + (L - 128); | 2105 size = ((M - 128) * 128) + (L - 128); |
| 2106 required = 8 + size * 2; | 2106 required = 8 + size * 2; |
| 4550 int size; /* size of data. */ | 4550 int size; /* size of data. */ |
| 4551 int on_stack; /* 1 if allocated by alloca. */ | 4551 int on_stack; /* 1 if allocated by alloca. */ |
| 4552 unsigned char *data; | 4552 unsigned char *data; |
| 4553 }; | 4553 }; |
| 4554 | 4554 |
| 4555 /* Don't use alloca for allocating memory space larger than this, lest | |
| 4556 we overflow their stack. */ | |
| 4557 #define MAX_ALLOCA 16*1024 | |
| 4558 | |
| 4559 /* Allocate LEN bytes of memory for BUF (struct conversion_buffer). */ | 4555 /* Allocate LEN bytes of memory for BUF (struct conversion_buffer). */ |
| 4560 #define allocate_conversion_buffer(buf, len) \ | 4556 #define allocate_conversion_buffer(buf, len) \ |
| 4561 do { \ | 4557 do { \ |
| 4562 if (len < MAX_ALLOCA) \ | 4558 if (len < MAX_ALLOCA) \ |
| 4563 { \ | 4559 { \ |
| 6656 XSETCAR (tail, list5 (XCAR (elt), XCDR (elt), | 6652 XSETCAR (tail, list5 (XCAR (elt), XCDR (elt), |
| 6657 translation_table, hash_table, | 6653 translation_table, hash_table, |
| 6658 accept_latin_extra)); | 6654 accept_latin_extra)); |
| 6659 } | 6655 } |
| 6660 } | 6656 } |
| 6661 | 6657 |
| 6662 if (! encodable | 6658 if (! encodable |
| 6663 && ((CHAR_TABLE_P (translation_table) | 6659 && ((CHAR_TABLE_P (translation_table) |
| 6664 && ! NILP (Faref (translation_table, ch))) | 6660 && ! NILP (Faref (translation_table, ch))) |
| 6665 || (HASH_TABLE_P (hash_table) | 6661 || (HASH_TABLE_P (hash_table) |
| 6666 && ! NILP (Fgethash (ch, hash_table, Qnil))) | 6662 && ! NILP (Fgethash (ch, hash_table, Qnil))) |
