mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
crypto.pem: add Block.free() method (#17045)
This commit is contained in:
parent
fed6524803
commit
25f1b713aa
@ -62,6 +62,19 @@ pub mut:
|
|||||||
data []u8
|
data []u8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// free the resources taken by the Block `block`
|
||||||
|
[unsafe]
|
||||||
|
pub fn (mut block Block) free() {
|
||||||
|
$if prealloc {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
unsafe {
|
||||||
|
block.block_type.free()
|
||||||
|
block.headers.free()
|
||||||
|
block.data.free()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// returns a new `Block` with the specified block_type
|
// returns a new `Block` with the specified block_type
|
||||||
[inline]
|
[inline]
|
||||||
pub fn new(block_type string) Block {
|
pub fn new(block_type string) Block {
|
||||||
|
Loading…
Reference in New Issue
Block a user