diff options
| author | Eli Zaretskii | 2017-02-10 12:12:49 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2017-02-10 12:12:49 +0200 |
| commit | c54cf8dcfd016783bc4881eb218d7b556020a18c (patch) | |
| tree | 2c9ef2be10d4c6132cb3ac63e64939841fe1daed /src | |
| parent | 8b92f8672b5ed6fe38d10654962aa373e8e7bda8 (diff) | |
| download | emacs-c54cf8dcfd016783bc4881eb218d7b556020a18c.tar.gz emacs-c54cf8dcfd016783bc4881eb218d7b556020a18c.zip | |
Improve commentary in lisp.h
* src/lisp.h: Explain in the comment why enlarging a Lisp_Misc
object is discouraged.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lisp.h b/src/lisp.h index b410ee45aed..5aee80cea11 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -511,10 +511,14 @@ enum Lisp_Fwd_Type | |||
| 511 | to add a new Lisp_Misc, extend the Lisp_Misc_Type enumeration. | 511 | to add a new Lisp_Misc, extend the Lisp_Misc_Type enumeration. |
| 512 | 512 | ||
| 513 | For a Lisp_Misc, you will also need to add your entry to union | 513 | For a Lisp_Misc, you will also need to add your entry to union |
| 514 | Lisp_Misc (but make sure the first word has the same structure as | 514 | Lisp_Misc, but make sure the first word has the same structure as |
| 515 | the others, starting with a 16-bit member of the Lisp_Misc_Type | 515 | the others, starting with a 16-bit member of the Lisp_Misc_Type |
| 516 | enumeration and a 1-bit GC markbit) and make sure the overall size | 516 | enumeration and a 1-bit GC markbit. Also make sure the overall |
| 517 | of the union is not increased by your addition. | 517 | size of the union is not increased by your addition. The latter |
| 518 | requirement is to keep Lisp_Misc objects small enough, so they | ||
| 519 | are handled faster: since all Lisp_Misc types use the same space, | ||
| 520 | enlarging any of them will affect all the rest. If you really | ||
| 521 | need a larger object, it is best to use Lisp_Vectorlike instead. | ||
| 518 | 522 | ||
| 519 | For a new pseudovector, it's highly desirable to limit the size | 523 | For a new pseudovector, it's highly desirable to limit the size |
| 520 | of your data type by VBLOCK_BYTES_MAX bytes (defined in alloc.c). | 524 | of your data type by VBLOCK_BYTES_MAX bytes (defined in alloc.c). |