mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-03-17 10:10:47 -07:00
Merge branch 'master' into 'master'
Allow the creation of early classes with the correct size. See merge request embeddable-common-lisp/ecl!362
This commit is contained in:
commit
a37458ec78
2 changed files with 9 additions and 6 deletions
|
|
@ -18,13 +18,15 @@
|
|||
;;; We cannot use the functions CREATE-STANDARD-CLASS and others because SLOTS,
|
||||
;;; DIRECT-SLOTS, etc are empty and therefore SLOT-VALUE does not work.
|
||||
|
||||
(defun make-empty-standard-class (name &key (metaclass 'standard-class)
|
||||
direct-superclasses direct-slots index)
|
||||
(defun make-empty-standard-class
|
||||
(name &key (metaclass 'standard-class)
|
||||
direct-superclasses direct-slots index
|
||||
(size #.(length +standard-class-slots+)))
|
||||
(declare (optimize speed (safety 0)))
|
||||
(let* ((the-metaclass (and metaclass (gethash metaclass si::*class-name-hash-table*)))
|
||||
(let* ((the-metaclass
|
||||
(and metaclass (gethash metaclass si::*class-name-hash-table*)))
|
||||
(class (or (gethash name si::*class-name-hash-table*)
|
||||
(si:allocate-raw-instance nil the-metaclass
|
||||
#.(length +standard-class-slots+)))))
|
||||
(si:allocate-raw-instance nil the-metaclass size))))
|
||||
(with-early-accessors (+standard-class-slots+)
|
||||
(when (eq name 'standard-class)
|
||||
(defconstant +the-standard-class+ class)
|
||||
|
|
|
|||
|
|
@ -374,6 +374,7 @@
|
|||
:direct-slots #.+structure-class-slots+)
|
||||
(structure-object
|
||||
:metaclass structure-class
|
||||
:direct-superclasses (t))
|
||||
:direct-superclasses (t)
|
||||
:size #.(length +structure-class-slots+))
|
||||
)))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue