-(defun %make-alien (bits)
- (declare (type index bits))
- (alien-funcall (extern-alien "malloc"
- (function system-area-pointer unsigned))
- (ash (the index (+ bits 7)) -3)))
+(defun %make-alien (bytes)
+ (declare (type index bytes)
+ (optimize (sb!c:alien-funcall-saves-fp-and-pc 0)))
+ (let ((sap (alien-funcall (extern-alien "malloc"
+ (function system-area-pointer size-t))
+ bytes)))
+ (if (and (not (eql 0 bytes)) (eql 0 (sap-int sap)))
+ (malloc-error bytes (get-errno))
+ sap)))