1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

doc: add[unsafe] and [manualfree] (#9038)

This commit is contained in:
Ben-Fields 2021-03-01 14:36:37 -06:00 committed by GitHub
parent db9b523cc9
commit 2be3a72df6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3996,6 +3996,16 @@ fn bar() {
foo() // will not be called if `-d debug` is not passed
}
// Calls to this function must be in unsafe{} blocks
[unsafe]
fn risky_business() {
}
// V's autofree engine will not take care of memory management in this function
[manualfree]
fn custom_allocations() {
}
// For C interop only, tells V that the following struct is defined with `typedef struct` in C
[typedef]
struct C.Foo {