[LLVMdev] Error on completing ToyThread::execute() in ToyVM (vmkit project)

mkh mkh159 at gmail.com
Sat Sep 21 05:46:16 PDT 2013


Hi all,

I changed the the operator new method of ToyRoot class as follows:

template <class T>
void* operator new(size_t sz, int param=0) {
    void* res = 0;
    llvm_gcroot(res, 0);
    static T o;
    VirtualTable *tmp;
  tmp=const_cast<VirtualTable*>(VirtualTable::getVirtualTable((gc*)&o));
    res = gc::operator new(sz, tmp);
    return res;
}

By running the "static T o" the following message printed:

toyVM: ../lib/ToyRoot.h:31: Toy::ToyRoot::ToyRoot(): Assertion `false'
failed.


Best regards,
Mkh


On Wed, 2013-09-18 at 15:13 +0200, Harris Bakiras wrote:
> Hi,
> 
> The VMKit framework has been updated to be more generic.
> The getVirtualTable method is not exposed anymore since this method suppose
> that your object layout contains a virtual table.
> Now you have new methods to get / set objects type which are virtual methods
> inherited by the vmkit::VirtualMachine class.
> 
> Thus you can still keep your object identity as virtual tables, but now the
> getVirtualTable is a static method provided by the VirtualTable class.
>  
> --
> Harris Bakiras
> 
> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
> Behalf Of mkh
> Sent: mercredi 18 septembre 2013 13:44
> To: LLVMdev
> Subject: [LLVMdev] Error on completing ToyThread::execute() in ToyVM (vmkit
> project)
> 
> 
> --
> Hi all,
> 
> My code is:
>     TOY_VAR(Picture*, aPic);    
>     aPic = Picture::doNew(-2, 1, -1, 1, 1900, 1200);
> 
> This code has the following compilation error:
> ../lib/ToyRoot.h:41:33: error: no member named 'getVirtualTable' in
> 'Toy::Picture'
>                         res = gc::operator new(sz, o.getVirtualTable());
>                                                    ~ ^ Is it correct?
> 
> Best regards,
> Mkh
> 
> 
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 




More information about the llvm-dev mailing list