diff options
| author | Dmitry Antipov | 2012-12-26 18:10:11 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-12-26 18:10:11 +0400 |
| commit | 8847a0de5bd2e0df62f85c53c4b8d57d942d49ba (patch) | |
| tree | f99dfa2d00682881fa829f83c5eee085b0e1ca82 /src | |
| parent | 2e0515202201e83d1845918760c888805164d369 (diff) | |
| download | emacs-8847a0de5bd2e0df62f85c53c4b8d57d942d49ba.tar.gz emacs-8847a0de5bd2e0df62f85c53c4b8d57d942d49ba.zip | |
* lisp.h (toplevel): Add two notices to the comment about
defining a new Lisp data type.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/lisp.h | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8a228214507..d0e08317fba 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru> | 1 | 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 2 | ||
| 3 | * lisp.h (toplevel): Add two notices to the comment about | ||
| 4 | defining a new Lisp data type. | ||
| 5 | |||
| 6 | 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 7 | |||
| 3 | * keyboard.c (record_asynch_buffer_change): Initialize an event | 8 | * keyboard.c (record_asynch_buffer_change): Initialize an event |
| 4 | only if it's really needed. | 9 | only if it's really needed. |
| 5 | * frame.h (enum output_method): Remove output_mac member since | 10 | * frame.h (enum output_method): Remove output_mac member since |
diff --git a/src/lisp.h b/src/lisp.h index cfdff6cf514..d8d61e4b6d9 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -325,6 +325,10 @@ enum Lisp_Fwd_Type | |||
| 325 | members that are accessible only from C. A Lisp_Misc object is a | 325 | members that are accessible only from C. A Lisp_Misc object is a |
| 326 | wrapper for a C struct that can contain anything you like. | 326 | wrapper for a C struct that can contain anything you like. |
| 327 | 327 | ||
| 328 | Explicit freeing is discouraged for Lisp objects in general. But if | ||
| 329 | you really need to exploit this, use Lisp_Misc (check free_misc in | ||
| 330 | alloc.c to see why). There is no way to free a vectorlike object. | ||
| 331 | |||
| 328 | To add a new pseudovector type, extend the pvec_type enumeration; | 332 | To add a new pseudovector type, extend the pvec_type enumeration; |
| 329 | to add a new Lisp_Misc, extend the Lisp_Misc_Type enumeration. | 333 | to add a new Lisp_Misc, extend the Lisp_Misc_Type enumeration. |
| 330 | 334 | ||
| @@ -334,6 +338,10 @@ enum Lisp_Fwd_Type | |||
| 334 | enumeration and a 1-bit GC markbit) and make sure the overall size | 338 | enumeration and a 1-bit GC markbit) and make sure the overall size |
| 335 | of the union is not increased by your addition. | 339 | of the union is not increased by your addition. |
| 336 | 340 | ||
| 341 | For a new pseudovector, it's highly desirable to limit the size | ||
| 342 | of your data type by VBLOCK_BYTES_MAX bytes (defined in alloc.c). | ||
| 343 | Otherwise you will need to change sweep_vectors (also in alloc.c). | ||
| 344 | |||
| 337 | Then you will need to add switch branches in print.c (in | 345 | Then you will need to add switch branches in print.c (in |
| 338 | print_object, to print your object, and possibly also in | 346 | print_object, to print your object, and possibly also in |
| 339 | print_preprocess) and to alloc.c, to mark your object (in | 347 | print_preprocess) and to alloc.c, to mark your object (in |