From 1eab718d4ff970db00744092125d4f625e28395c Mon Sep 17 00:00:00 2001 From: yuqing Date: Mon, 25 Jul 2016 12:46:44 +0800 Subject: [PATCH] modify php-fastcommon/test.php --- HISTORY | 3 +++ php-fastcommon/test.php | 8 ++++++++ src/fast_mblock.c | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/HISTORY b/HISTORY index afe186a..1fe6c09 100644 --- a/HISTORY +++ b/HISTORY @@ -1,4 +1,7 @@ +Version 1.30 2016-07-25 + * modify php-fastcommon/test.php + Version 1.29 2016-06-17 * ini_file_reader support #@if * ini_file_reader support #@for diff --git a/php-fastcommon/test.php b/php-fastcommon/test.php index 7ab2efd..f53581f 100644 --- a/php-fastcommon/test.php +++ b/php-fastcommon/test.php @@ -24,7 +24,15 @@ printf("id: %d %X, extra: %d, timestamp: %d\n", $id, $id, fastcommon_id_generator_get_timestamp($id)); 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); +echo 'extra no: ' . fastcommon_id_generator_get_extra($id, $handle1) . "\n"; + $handle2 = fastcommon_id_generator_init("/tmp/sn2.txt", 0, 8, 8, 16); $id = fastcommon_id_generator_next(1, $handle1); diff --git a/src/fast_mblock.c b/src/fast_mblock.c index cfd6a28..1fa3a22 100644 --- a/src/fast_mblock.c +++ b/src/fast_mblock.c @@ -791,7 +791,7 @@ OUTER: "reclaim trunks for %p, reclaimed trunks: %d, " "free node count: %d", __LINE__, mblock, *reclaim_count, fast_mblock_free_count(mblock)); - mblock->need_lock = mblock->need_lock; + mblock->need_lock = old_need_lock; } *ppFreelist = freelist;