diff options
author | vnugent <public@vaughnnugent.com> | 2023-03-28 00:30:25 -0400 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2023-03-28 00:30:25 -0400 |
commit | cf45636b6216d1b2beaec83bb129a1927f24f608 (patch) | |
tree | 97553ecbff6189602c24ad0d600005ecc9f5086c /lib/NativeHeapApi/README.md | |
parent | 0fe1b687531710071d7c5a85cc59577481a06c9b (diff) |
Readme and spelling
Diffstat (limited to 'lib/NativeHeapApi/README.md')
-rw-r--r-- | lib/NativeHeapApi/README.md | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/NativeHeapApi/README.md b/lib/NativeHeapApi/README.md index 5341e63..36d3a6e 100644 --- a/lib/NativeHeapApi/README.md +++ b/lib/NativeHeapApi/README.md @@ -6,21 +6,27 @@ Contains necessary API header files for user defined heap dlls. Contains the req You may copy the [NativeHeapApi.h](src/NativeHeapApi.h) header file into your project and begin implementing the heap methods defined in the header file. -You must define a constant called **HEAP_METHOD_EXPORT** that defines the method calling convention for proper dll loading for your given platform. On windows, this defaults to `__declspec(dllexport)`. +You must define a constant called **HEAP_METHOD_EXPORT** that defines the method decordation for proper dll loading for your given platform. On windows, this defaults to `__declspec(dllexport)`. -When the `heapCreate` method is called, a mutable structure pointer is passed as an argument and expected to be updated by your create method. The VNLib.Utils library implements two types of heaps, a global/shared heap and "private" or "first class" heaps exposed by the Memory namespace. Consumers are allowed to create a private heap to use at will. +You may optionally define a constant **HEAP_METHOD_CC**, which defines the method calling convention. For a windows target, this defaults to __stdcall, as P/Invoke uses the stdcall calling convention. On other platforms this expands to nothimg and P/Invoke uses the CDECL, the default on most platforms. -### UnmanagedHeapFlags structure +When the `heapCreate` method is called, a mutable structure pointer is passed as an argument and expected to be updated by your create method. The VNLib.Utils library implements two types of heaps, a global/shared heap and "private" or "first class" heaps exposed by the Memory namespace. Consumers are allowed to create a private heap to use at will. -`UnmanagedHeapFlags.HeapPointer` - Set your heap pointer that will be passed to all heap methods +### Heap architecture -`UnmanagedHeapFlags.CreationFlags` - Managed creation flags, that may be read and written. The managed heap implementation will observe the result after the `heapCreate` method returns. +To understand the VNLib.Utils heap architecture, please see the Utils [readme](../Utils/README.md). -`UnmanagedHeapFlags.Flags` - Generic flags passed by the caller directly to the heapCreate method, not observed or modified by the managed library in any way. +### UnmanagedHeapDescriptor structure + +`UnmanagedHeapDescriptor.HeapPointer` - Set your heap pointer that will be passed to all heap methods + +`UnmanagedHeapDescriptor.CreationFlags` - Managed creation flags, that may be read and written. The managed heap implementation will observe the result after the `heapCreate` method returns. + +`UnmanagedHeapDescriptor.Flags` - Generic flags passed by the caller directly to the heapCreate method, not observed or modified by the managed library in any way. ### Example Create ``` c -HEAP_METHOD_EXPORT ERRNO heapCreate(UnmanagedHeapFlags* flags) +HEAP_METHOD_EXPORT ERRNO HEAP_METHOD_CC heapCreate(UnmanagedHeapDescriptor* flags) { //Check flags if (flags->CreationFlags & HEAP_CREATION_IS_SHARED) |