modify php-fastcommon/test.php
parent
1c2b72f9a6
commit
1eab718d4f
3
HISTORY
3
HISTORY
|
|
@ -1,4 +1,7 @@
|
||||||
|
|
||||||
|
Version 1.30 2016-07-25
|
||||||
|
* modify php-fastcommon/test.php
|
||||||
|
|
||||||
Version 1.29 2016-06-17
|
Version 1.29 2016-06-17
|
||||||
* ini_file_reader support #@if
|
* ini_file_reader support #@if
|
||||||
* ini_file_reader support #@for
|
* ini_file_reader support #@for
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,15 @@ printf("id: %d %X, extra: %d, timestamp: %d\n", $id, $id,
|
||||||
fastcommon_id_generator_get_timestamp($id));
|
fastcommon_id_generator_get_timestamp($id));
|
||||||
unset($handle);
|
unset($handle);
|
||||||
|
|
||||||
|
/*
|
||||||
|
resource fastcommon_id_generator_init([string filename = "/tmp/fastcommon_id_generator.sn",
|
||||||
|
int machine_id = 0, int mid_bits = 16, int extra_bits = 0, int sn_bits = 16])
|
||||||
|
*/
|
||||||
|
|
||||||
|
$id = 6301319781687017475;
|
||||||
$handle1 = fastcommon_id_generator_init("/tmp/sn1.txt", 0, 8, 10, 14);
|
$handle1 = fastcommon_id_generator_init("/tmp/sn1.txt", 0, 8, 10, 14);
|
||||||
|
echo 'extra no: ' . fastcommon_id_generator_get_extra($id, $handle1) . "\n";
|
||||||
|
|
||||||
$handle2 = fastcommon_id_generator_init("/tmp/sn2.txt", 0, 8, 8, 16);
|
$handle2 = fastcommon_id_generator_init("/tmp/sn2.txt", 0, 8, 8, 16);
|
||||||
|
|
||||||
$id = fastcommon_id_generator_next(1, $handle1);
|
$id = fastcommon_id_generator_next(1, $handle1);
|
||||||
|
|
|
||||||
|
|
@ -791,7 +791,7 @@ OUTER:
|
||||||
"reclaim trunks for %p, reclaimed trunks: %d, "
|
"reclaim trunks for %p, reclaimed trunks: %d, "
|
||||||
"free node count: %d", __LINE__,
|
"free node count: %d", __LINE__,
|
||||||
mblock, *reclaim_count, fast_mblock_free_count(mblock));
|
mblock, *reclaim_count, fast_mblock_free_count(mblock));
|
||||||
mblock->need_lock = mblock->need_lock;
|
mblock->need_lock = old_need_lock;
|
||||||
}
|
}
|
||||||
|
|
||||||
*ppFreelist = freelist;
|
*ppFreelist = freelist;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue