Hi all,
When using define-type, is memory somehow allocated for the slots of the just
created prototype?
>From what I see in its definition:
(let ((proto [(import ,[baseName asString]) _delegated])) ; this is the new
type
[[proto _vtable] methodAt: '_sizeof put: (lambda (_closure _self
self) ,[SmallInteger value_: protoSize]) with: 0]
_delegated and _sizeof are the only links I see to memory allocation.
I am assuming _delegated will allocate a new vtable, while _sizeof will make
sure objects created with "new" get enough memory allocated for their slots.
Is that correct so far?
So what about the slots of the newly defined proto itself? (called "proto" in
the above code extract)
Apparently, the following works:
(define-type MyType Object (x y))
[MyType x: '5]
But maybe that's just pure luck and I'm actually accessing unallocated memory?
Thanks,
Hans
--
A liberal is a person whose interests aren't at stake at the moment
-- Willis Player
Hans Schippers
Research Assistant of the Research Foundation - Flanders (FWO - Vlaanderen)
http://www.win.ua.ac.be/~hschipp/
Formal Techniques in Software Engineering (FoTS)
University of Antwerp
Middelheimlaan 1
2020 Antwerpen - Belgium
Phone: +32 3 265 38 71
Fax: +32 3 265 37 77
_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc