]> gitweb.factorcode.org Git - factor.git/blob - extra/sodium/sodium-docs.factor
inverse: Fix docs
[factor.git] / extra / sodium / sodium-docs.factor
1 ! Copyright (C) 2020 Alexander Ilin.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien help.markup help.syntax kernel sodium.ffi ;
4 IN: sodium
5
6 HELP: check-malloc
7 { $values
8   { "ptr" alien }
9   { "ptr/*" alien }
10 }
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." } ;
12
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." } ;