Jump to content
823 posts in this topic

Recommended Posts

3 minutes ago, Jief_Machak said:

You just put back again the "AllocateZeroPool" for allocating objects !!!

Please don't : it CAN'T work for objects with virtual method. Of course it crashed.

Else memset is generated.

1 minute ago, Jief_Machak said:

Let me fix it and commit.

OK. But I want you to test the result.

2 minutes ago, Jief_Machak said:

I was asking about the memset. Because at my last commit, it was compiling and running with GCC and CLang.

Running? I always have a hang at getLEGACY_ENTRY() or with getLOADER_ENTRY()

My doubts:

MainMenu.Entries[] allocated as REFIT_ABSTRACT_MENU_ENTRY with a sizeof(REFIT_ABSTRACT_MENU_ENTRY) even if operator new used.

But LEGACY_ENTRY is larger.

To make a superclass big enough there is a method to add empty slots to it.

Really I don't know what to do if not revert classes to structures.

If you can resolve it for gcc then I will not test with VS.

It was working ! Entry are allocate with new. NO SIZEOF.

Wait a minute.

2 minutes ago, Slice said:

MainMenu.Entries[] allocated as REFIT_ABSTRACT_MENU_ENTRY with a sizeof(REFIT_ABSTRACT_MENU_ENTRY)

That is wrong. Must use new WITHOUT a sizeof parameter.

I assume he means that he is allocating an array but it is not allocated properly? I think he means, the size of the allocation is only one REFIT_ABSTRACT_MENU_ENTRY instead of the size for count the array elements.

 

EDIT: In c++ a struct is a class where the scope is public by default, instead of private. Every class (and therefore every struct) is given a default no argument constructor, copy constructor, and assignment operator if they are not defined for the class.

Edited by apianti

VS2017 seems to generate memset at new, as you said.

I tried to define default ctor. If there is a default ctor, zeroing object memory is not needed. But VS seesm to still generate it...

Providing an implementation for memset doesn't work if /GL is used for compilation.

So far, I just remove the /GL.

 

I didn't try to launch the efi made by VS...

×
×
  • Create New...