Results 1 to 2 of 2

Thread: Retrieving pointer created/consumed by VkAllocationCallbacks

  1. #1
    Newbie
    Join Date
    Aug 2017
    Posts
    1

    Retrieving pointer created/consumed by VkAllocationCallbacks

    Suppose I have a handle to an object allocated with VkAllocationCallbacks I wrote myself. Using only the object handle, is there any way to retrieve the void* pointer returned by pfnAllocation, the same pointer that would be passed to pfnReallocation or pfnFree, but without actually resizing or destroying the object?

    I want to experiment with allocating/storing extra metadata along with the object data using the same block of memory while still simply passing the object handle around. Something similar to cbWndExtra + GetWindowLongPtr/SetWindowLongPtr for Win32 windows.

  2. #2
    Quote Originally Posted by junkchoi View Post
    Suppose I have a handle to an object allocated with VkAllocationCallbacks I wrote myself. Using only the object handle, is there any way to retrieve the void* pointer returned by pfnAllocation, the same pointer that would be passed to pfnReallocation or pfnFree, but without actually resizing or destroying the object?
    No.

    Quote Originally Posted by junkchoi View Post
    I want to experiment with allocating/storing extra metadata along with the object data using the same block of memory while still simply passing the object handle around. Something similar to cbWndExtra + GetWindowLongPtr/SetWindowLongPtr for Win32 windows.
    To me, the most effective way to do that is to have a map from handles to the data.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean