Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type PFN_vkInternalAllocationNotification = FunPtr FN_vkInternalAllocationNotification
- type FN_vkInternalAllocationNotification = ("pUserData" ::: Ptr ()) -> CSize -> InternalAllocationType -> SystemAllocationScope -> IO ()
- type PFN_vkInternalFreeNotification = FunPtr FN_vkInternalFreeNotification
- type FN_vkInternalFreeNotification = ("pUserData" ::: Ptr ()) -> CSize -> InternalAllocationType -> SystemAllocationScope -> IO ()
- type PFN_vkReallocationFunction = FunPtr FN_vkReallocationFunction
- type FN_vkReallocationFunction = ("pUserData" ::: Ptr ()) -> ("pOriginal" ::: Ptr ()) -> CSize -> ("alignment" ::: CSize) -> SystemAllocationScope -> IO (Ptr ())
- type PFN_vkAllocationFunction = FunPtr FN_vkAllocationFunction
- type FN_vkAllocationFunction = ("pUserData" ::: Ptr ()) -> CSize -> ("alignment" ::: CSize) -> SystemAllocationScope -> IO (Ptr ())
- type PFN_vkFreeFunction = FunPtr FN_vkFreeFunction
- type FN_vkFreeFunction = ("pUserData" ::: Ptr ()) -> ("pMemory" ::: Ptr ()) -> IO ()
- type PFN_vkVoidFunction = FunPtr FN_vkVoidFunction
- type FN_vkVoidFunction = () -> IO ()
Documentation
type PFN_vkInternalAllocationNotification = FunPtr FN_vkInternalAllocationNotification Source #
PFN_vkInternalAllocationNotification - Application-defined memory allocation notification function
Parameters
pUserData
is the value specified forAllocationCallbacks
::pUserData
in the allocator specified by the application.
size
is the requested size of an allocation.allocationType
is aInternalAllocationType
value specifying the requested type of an allocation.allocationScope
is aSystemAllocationScope
value specifying the allocation scope of the lifetime of the allocation, as described here.
Description
This is a purely informational callback.
See Also
type FN_vkInternalAllocationNotification = ("pUserData" ::: Ptr ()) -> CSize -> InternalAllocationType -> SystemAllocationScope -> IO () Source #
type PFN_vkInternalFreeNotification = FunPtr FN_vkInternalFreeNotification Source #
PFN_vkInternalFreeNotification - Application-defined memory free notification function
Parameters
pUserData
is the value specified forAllocationCallbacks
::pUserData
in the allocator specified by the application.
size
is the requested size of an allocation.allocationType
is aInternalAllocationType
value specifying the requested type of an allocation.allocationScope
is aSystemAllocationScope
value specifying the allocation scope of the lifetime of the allocation, as described here.
See Also
type FN_vkInternalFreeNotification = ("pUserData" ::: Ptr ()) -> CSize -> InternalAllocationType -> SystemAllocationScope -> IO () Source #
type PFN_vkReallocationFunction = FunPtr FN_vkReallocationFunction Source #
PFN_vkReallocationFunction - Application-defined memory reallocation function
Parameters
pUserData
is the value specified forAllocationCallbacks
::pUserData
in the allocator specified by the application.
pOriginal
must be eitherNULL
or a pointer previously returned bypfnReallocation
orpfnAllocation
of a compatible allocator.size
is the size in bytes of the requested allocation.alignment
is the requested alignment of the allocation in bytes and must be a power of two.allocationScope
is aSystemAllocationScope
value specifying the allocation scope of the lifetime of the allocation, as described here.
Description
pfnReallocation
must return an allocation with enough space for
size
bytes, and the contents of the original allocation from bytes
zero to min(original size, new size) - 1 must be preserved in the
returned allocation. If size
is larger than the old size, the contents
of the additional space are undefined. If satisfying these requirements
involves creating a new allocation, then the old allocation should be
freed.
If pOriginal
is NULL
, then pfnReallocation
must behave
equivalently to a call to PFN_vkAllocationFunction
with the same
parameter values (without pOriginal
).
If size
is zero, then pfnReallocation
must behave equivalently to
a call to PFN_vkFreeFunction
with the same pUserData
parameter
value, and pMemory
equal to pOriginal
.
If pOriginal
is non-NULL
, the implementation must ensure that
alignment
is equal to the alignment
used to originally allocate
pOriginal
.
If this function fails and pOriginal
is non-NULL
the application
must not free the old allocation.
pfnReallocation
must follow the same
rules for return values as.
See Also
type FN_vkReallocationFunction = ("pUserData" ::: Ptr ()) -> ("pOriginal" ::: Ptr ()) -> CSize -> ("alignment" ::: CSize) -> SystemAllocationScope -> IO (Ptr ()) Source #
type PFN_vkAllocationFunction = FunPtr FN_vkAllocationFunction Source #
PFN_vkAllocationFunction - Application-defined memory allocation function
Parameters
pUserData
is the value specified forAllocationCallbacks
::pUserData
in the allocator specified by the application.
size
is the size in bytes of the requested allocation.alignment
is the requested alignment of the allocation in bytes and must be a power of two.allocationScope
is aSystemAllocationScope
value specifying the allocation scope of the lifetime of the allocation, as described here.
Description
If pfnAllocation
is unable to allocate the requested memory, it must
return NULL
. If the allocation was successful, it must return a
valid pointer to memory allocation containing at least size
bytes, and
with the pointer value being a multiple of alignment
.
Note
Correct Vulkan operation cannot be assumed if the application does not follow these rules.
For example, pfnAllocation
(or pfnReallocation
) could cause
termination of running Vulkan instance(s) on a failed allocation for
debugging purposes, either directly or indirectly. In these
circumstances, it cannot be assumed that any part of any affected
Instance
objects are going to operate correctly
(even destroyInstance
), and the
application must ensure it cleans up properly via other means (e.g.
process termination).
If pfnAllocation
returns NULL
, and if the implementation is unable
to continue correct processing of the current command without the
requested allocation, it must treat this as a run-time error, and
generate ERROR_OUT_OF_HOST_MEMORY
at the
appropriate time for the command in which the condition was detected, as
described in
Return Codes.
If the implementation is able to continue correct processing of the
current command without the requested allocation, then it may do so,
and must not generate
ERROR_OUT_OF_HOST_MEMORY
as a result of
this failed allocation.
See Also
type FN_vkAllocationFunction = ("pUserData" ::: Ptr ()) -> CSize -> ("alignment" ::: CSize) -> SystemAllocationScope -> IO (Ptr ()) Source #
type PFN_vkFreeFunction = FunPtr FN_vkFreeFunction Source #
PFN_vkFreeFunction - Application-defined memory free function
Parameters
pUserData
is the value specified forAllocationCallbacks
::pUserData
in the allocator specified by the application.
pMemory
is the allocation to be freed.
Description
pMemory
may be NULL
, which the callback must handle safely. If
pMemory
is non-NULL
, it must be a pointer previously allocated by
pfnAllocation
or pfnReallocation
. The application should free this
memory.
See Also
type PFN_vkVoidFunction = FunPtr FN_vkVoidFunction Source #
PFN_vkVoidFunction - Dummy function pointer type returned by queries
See Also
type FN_vkVoidFunction = () -> IO () Source #