Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed callbacks #81

Merged
merged 2 commits into from
Jun 20, 2023
Merged

Fixed callbacks #81

merged 2 commits into from
Jun 20, 2023

Conversation

psiberx
Copy link
Collaborator

@psiberx psiberx commented Jun 20, 2023

  • Fixed flexible callbacks
  • Added comparison operators for ResourceAsyncReference

Copy link
Owner

@WopsS WopsS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

void InitializeBuffer(uint32_t aSize)
{
if (aSize > InlineSize)
{
if (!allocator)
{
allocator = AllocatorType::Get();
std::memcpy(&allocator, AllocatorType::Get(), sizeof(uint64_t));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::memcpy(&allocator, AllocatorType::Get(), sizeof(uint64_t));
std::memcpy(&allocator, AllocatorType::Get(), sizeof(Memory::IAllocator));

This is the vtable for allocator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to use uint64_t because allocator field is also uint64_t.
I guess we could use sizeof(Memory::IAllocator) to also define allocator.

@WopsS WopsS merged commit 7a1325e into WopsS:master Jun 20, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants