Skip to content

Commit 1560a1b

Browse files
committed
optimize multiple fetch on same request
1 parent bc3d3e3 commit 1560a1b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎ext/user_cache/user_cache_shared_graph.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6415,12 +6415,13 @@ static void ucache_ensure_shared_graph_ref_index(void)
64156415
}
64166416
}
64176417

6418-
/* Include the context to disambiguate equal offsets in different pools. */
6418+
/* The context disambiguates pools. Mixed because same-sized payloads sit a
6419+
* power-of-two stride apart and zend_hash buckets by the low bits. */
64196420
static zend_ulong ucache_shared_graph_ref_index_key(
64206421
const php_ucache_ctx_t *ctx,
64216422
uint32_t payload_offset)
64226423
{
6423-
return ((zend_ulong) (uintptr_t) ctx) ^ (zend_ulong) payload_offset;
6424+
return (zend_ulong) ucache_shared_graph_content_hash_mix((uint64_t) (uintptr_t) ctx, (uint64_t) payload_offset);
64246425
}
64256426

64266427
/* Returns true only when this drops the last reference of an already-retired

0 commit comments

Comments
 (0)