nv-mem-u32-rng-mgmt
v1.0.4
Published
nv-mem-u32-rng-mgmt ======================= - attr_0 - attr_1
Downloads
6
Readme
nv-mem-u32-rng-mgmt
- attr_0
- attr_1
install
- npm install nv-mem-u32-rng-mgmt
splitted
usage
const x = require("nv-mem-u32-rng-mgmt");
example
var rngs = x(1024*1024,2**32-1,0);
/*
Allocator(2097156) [Uint32Array] [
1, 1, 0, 4294967295, 0, 0,
*/
rngs.aloc(1024);
/*
Allocator(2097156) [Uint32Array] [
1, 1, 1024, 4294967295, 0, 0,
*/
rngs.free(256,512);
/*
Allocator(2097156) [Uint32Array] [
2, 1, 256, 512, 1024, 4294967295,
*/
rngs.aloc(512)
/*
[ 1024, 1536 ]
> rngs
Allocator(2097156) [Uint32Array] [
2, 1, 256, 512, 1536, 4294967295,
*/
rngs.free(512,1536)
/*
> rngs
Allocator(2097156) [Uint32Array] [
1, 1, 256, 4294967295, 0, 0,
*/
rngs.aloc(2048)
/*
[ 256, 2304 ]
> rngs
Allocator(2097156) [Uint32Array] [
1, 1, 2304, 4294967295, 0, 0,
*/
rngs.free(128,512);
/*
> rngs
Allocator(2097156) [Uint32Array] [
2, 1, 128, 512, 2304, 4294967295,
*/
rngs.free(600,2300)
/*
1700
> rngs
Allocator(2097156) [Uint32Array] [
3, 1, 128, 512, 600, 2300,
2304, 4294967295, 0, 0, 0, 0,
*/
rngs.free(0,128)
/*
> rngs
Allocator(2097156) [Uint32Array] [
3, 1, 0, 512, 600, 2300,
2304, 4294967295, 0, 0, 0, 0,
*/
rngs.free(0,512) //ignore
rngs.free(0,511) //ignore
rngs.free(1,512) //ignore
rngs.free(1,511) //ignore
rngs.free(512,600)
/*
> rngs
Allocator(2097156) [Uint32Array] [
2, 1, 0, 2300, 2304, 4294967295,
*/
/*
> rngs.free(2300,2304)
4
> rngs
Allocator(2097156) [Uint32Array] [
1, 1, 0, 4294967295, 0, 0,
*/
METHODS
APIS
LICENSE
- ISC