| 698 | } |
| 699 | |
| 700 | static bool cv2_zero(cv2_context_t *ctx, void *memory, size_t length) { |
| 701 | unsigned char *bytes = memory; |
| 702 | size_t at = 0; |
| 703 | while (at < length) { |
| 704 | if (!cv2_poll(ctx)) |
| 705 | return false; |
| 706 | size_t chunk = length - at; |
| 707 | if (chunk > 4096) |
| 708 | chunk = 4096; |
| 709 | memset(bytes + at, 0, chunk); |
| 710 | at += chunk; |
| 711 | } |
| 712 | return cv2_poll(ctx); |
| 713 | } |
| 714 | |
| 715 | static void *cv2_array(cv2_context_t *ctx, size_t count, size_t size) { |
| 716 | if (!count) |