src/streams.c

changeset 1318
12fa1d37fe48
parent 1065
6eb7b54975ee
child 1319
aa1f580f8f59
--- a/src/streams.c	Thu May 15 15:43:30 2025 +0200
+++ b/src/streams.c	Thu May 15 16:02:54 2025 +0200
@@ -27,6 +27,7 @@
  */
 
 #include "cx/streams.h"
+#include "cx/allocator.h"
 
 #ifndef CX_STREAM_BCOPY_BUF_SIZE
 #define CX_STREAM_BCOPY_BUF_SIZE 8192
@@ -57,7 +58,7 @@
         lbuf = buf;
     } else {
         if (bufsize == 0) bufsize = CX_STREAM_BCOPY_BUF_SIZE;
-        lbuf = malloc(bufsize);
+        lbuf = cxMalloc(cxDefaultAllocator, bufsize);
         if (lbuf == NULL) return 0;
     }
 
@@ -74,7 +75,7 @@
     }
 
     if (lbuf != buf) {
-        free(lbuf);
+        cxFree(cxDefaultAllocator, lbuf);
     }
 
     return ncp;

mercurial