comparison lispref/internals.texi @ 10476:4d87344e6dfb

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Thu, 19 Jan 1995 07:25:03 +0000
parents c5927c75b2b5
children 9a4ff0104cdc
comparison
equal deleted inserted replaced
10475:2d9590603a06 10476:4d87344e6dfb
501 These macros implicitly use local variables such as @code{gcpro1}; you 501 These macros implicitly use local variables such as @code{gcpro1}; you
502 must declare these explicitly, with type @code{struct gcpro}. Thus, if 502 must declare these explicitly, with type @code{struct gcpro}. Thus, if
503 you use @code{GCPRO2}, you must declare @code{gcpro1} and @code{gcpro2}. 503 you use @code{GCPRO2}, you must declare @code{gcpro1} and @code{gcpro2}.
504 Alas, we can't explain all the tricky details here. 504 Alas, we can't explain all the tricky details here.
505 505
506 Remember that you must never initialise external variables (whether
507 static or not). If you do that, the linker will put the variable into
508 the initialised data area of the process, which on many architectures
509 becomes read-only when emacs is dumped (@pxref {Pure Storage}).
510
511 Remember also that the keyword @code{static} is defined as nothing on
512 many architectures whose linkers would put every static variable in the
513 initialised data area, which becomes read-only after dumping. This
514 means that you must never use static local variables, because on those
515 architectures they would lose the @code{static} specifier and become
516 automatic. Use static external variables instead.
517
506 Defining the C function is not enough to make a Lisp primitive 518 Defining the C function is not enough to make a Lisp primitive
507 available; you must also create the Lisp symbol for the primitive and 519 available; you must also create the Lisp symbol for the primitive and
508 store a suitable subr object in its function cell. The code looks like 520 store a suitable subr object in its function cell. The code looks like
509 this: 521 this:
510 522