NAME

DiaColloDB::Temp::Vec - DiaColloDB: temporary mmaped vec() buffers

SYNOPSIS

##========================================================================
## PRELIMINARIES

use DiaColloDB::Temp::Vec;

##========================================================================
## Constructors etc.

$tmpvec = CLASS->new($size, $bits);

##========================================================================
## Accessors

\$buf = $tmpv->bufr();
$bits = $tmpv->bits();
$size = $tmpv->size();

DESCRIPTION

DiaColloDB::Temp::Hash provides a simple interface to large temporary vec() scalars mmap()ed to anonymous memory blocks. This is mostly useful to ensure that the memory used by large intermediate vectors is freed when the objects are destroyed, since mmap() bypasses perl's internal memory management.

Globals & Constants

Variable: @ISA

DiaColloDB::Temp::Hash inherits from DiaColloDB::Temp.

Variable: $LOG_DEFAULT

Default log-level for debugging; default=undef: off.

Constructors etc.

new
$tmpvec = CLASS->new($size, $bits);

Creates a new temporary buffer for use e.g. with vec() suitable for storing $size logical elements of $bits width each.

%opts, %$mmvec:

(
 log  => $level,      ##-- logging verbosity (default=$LOG_DEFAULT)
 buf  => $buf,        ##-- guts: real underlying mmap()ed buffer data
 size => $size,       ##-- number of logical elements
 bits => $bits,       ##-- number of bits per element
)

Accessors

bufr
\$buf = $tmpv->bufr();

Returns reference to the underlying mmap()ed buffer.

bits
$bits = $tmpv->bits();

Returns number of bits per logical element as specified in constructor.

size
$size = $tmpv->size();

Returns number of logical elements as specified in constructor.

AUTHOR

Bryan Jurish <moocow@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2015-2020 by Bryan Jurish

This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.

SEE ALSO

DiaColloDB::Temp::Array(3pm), DiaColloDB::Temp::Hash(3pm), DiaColloDB::PDL::MM(3pm), DiaColloDB::Temp(3pm), DiaColloDB(3pm), perl(1), ...