1 ! Copyright (C) 2020 Alexander Ilin.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: alien help.markup help.syntax kernel sodium.ffi ;
11 { $description "Check if " { $snippet "ptr" } " is " { $snippet "null" } " and throw " { $link sodium-malloc-error } " in that case. Otherwise simply leave " { $snippet "ptr" } " as is." } ;
13 HELP: sodium-malloc-error
14 { $description "Throws a " { $link sodium-malloc-error } " error." }
15 { $error-description "This error is thrown when " { $link sodium_malloc } " returns " { $snippet "null" } " due to memory allocation failure. Since each such allocation requires several pages of swap-protected memory, it is a limited resource in any OS." } ;