You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Caution Using `std::bind`](#caution-using-stdbind)
39
39
-[Caution Using Raw Object Pointers](#caution-using-raw-object-pointers)
@@ -563,17 +563,18 @@ std::istream& recv_stream;
563
563
// Receiver invokes the remote target function
564
564
delegateRemote.Invoke(recv_stream);
565
565
```
566
+
## Error Handling
567
+
568
+
The delegate library uses dynamic memory to send asynchronous delegate messages to the target thread. By default, out-of-memory failures throw a `std::bad_alloc` exception. Optionally, if `USE_ASSERTS` is defined, exceptions are not thrown, and an assert is triggered instead. See `DelegateOpt.h` for more details.
569
+
570
+
Remote delegate error handling is captured by registering a callback with `SetErrorHandler()`.
566
571
567
572
## Fixed-Block Memory Allocator
568
573
569
574
The delegate library optionally uses a fixed-block memory allocator when `USE_ALLOCATOR` is defined. See `DelegateOpt.h` for more details. The allocator design is available in the [stl_allocator](https://github.com/endurodave/stl_allocator) repository.
570
575
571
576
`std::function` used within class `DelegateFunction` may use the heap under certain conditions. Implement a custom `xfunction` similar to the `xlist` concept within `xlist.h` using the `xallocator` fixed-block allocator if deemed necessary.
572
577
573
-
## Error Handling
574
-
575
-
The delegate library uses dynamic memory to send asynchronous delegate messages to the target thread. By default, out-of-memory failures throw a `std::bad_alloc` exception. Optionally, if `USE_ASSERTS` is defined, exceptions are not thrown, and an assert is triggered instead. See `DelegateOpt.h` for more details.
576
-
577
578
## Function Argument Copy
578
579
579
580
The behavior of the delegate library when invoking asynchronous non-blocking delegates (e.g. `DelegateAsyncFree<>`) is to copy arguments into heap memory for safe transport to the destination thread. All arguments (if any) are duplicated. If your data is not plain old data (POD) and cannot be bitwise copied, ensure you implement an appropriate copy constructor to handle the copying.
0 commit comments