Function: make-record

make-record is a function defined in alloc.c.

Signature

(make-record TYPE SLOTS INIT)

Documentation

Create a new record.

TYPE is its type as returned by type-of; it should be either a symbol or a type descriptor. SLOTS is the number of non-type slots, each initialized to INIT.

View in manual

Probably introduced at or before Emacs version 26.1.

Source Code

// Defined in /usr/src/emacs/src/alloc.c
{
  CHECK_FIXNAT (slots);
  EMACS_INT size = XFIXNAT (slots) + 1;
  struct Lisp_Vector *p = allocate_record (size);
  p->contents[0] = type;
  for (ptrdiff_t i = 1; i < size; i++)
    p->contents[i] = init;
  return make_lisp_ptr (p, Lisp_Vectorlike);
}