ERROR: libc-error errno message ;
-: (throw-errno) ( errno -- * ) dup strerror throw-libc-error ;
+: (throw-errno) ( errno -- * ) dup strerror libc-error ;
: throw-errno ( -- * ) errno (throw-errno) ;
drop "Memory allocation failed" ;
: check-ptr ( c-ptr -- c-ptr )
- [ throw-bad-ptr ] unless* ;
+ [ bad-ptr ] unless* ;
ERROR: realloc-error ptr size ;
: realloc ( alien size -- newalien )
[ >c-ptr ] dip
- over malloc-exists? [ throw-realloc-error ] unless
+ over malloc-exists? [ realloc-error ] unless
[ drop ] [ (realloc) check-ptr ] 2bi
[ delete-malloc ] [ add-malloc ] bi* ;
FUNCTION: void memcpy ( void* dst, void* src, ulong size )
+FUNCTION: void memmove ( void* dst, void* src, ulong size )
+
FUNCTION: int memcmp ( void* a, void* b, ulong size )
: memory= ( a b size -- ? ) memcmp 0 = ; inline