ERROR: libc-error errno message ;
-: (throw-errno) ( errno -- * ) dup strerror libc-error ;
+: (throw-errno) ( errno -- * ) dup strerror throw-libc-error ;
: throw-errno ( -- * ) errno (throw-errno) ;
drop "Memory allocation failed" ;
: check-ptr ( c-ptr -- c-ptr )
- [ bad-ptr ] unless* ;
+ [ throw-bad-ptr ] unless* ;
ERROR: realloc-error ptr size ;
: realloc ( alien size -- newalien )
[ >c-ptr ] dip
- over malloc-exists? [ realloc-error ] unless
+ over malloc-exists? [ throw-realloc-error ] unless
[ drop ] [ (realloc) check-ptr ] 2bi
[ delete-malloc ] [ add-malloc ] bi* ;