MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_global_buffer_pool

Function test_global_buffer_pool

src/protocol/buffer_pool.rs:520–533  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

518
519 #[test]
520 fn test_global_buffer_pool() {
521 let buffer1 = get_pooled_buffer();
522 let buffer2 = get_pooled_buffer();
523
524 // Both should come from the same global pool
525 assert!(buffer1.capacity() > 0);
526 assert!(buffer2.capacity() > 0);
527
528 drop(buffer1);
529 drop(buffer2);
530
531 let stats = global_buffer_pool().get_stats();
532 assert!(stats.buffers_allocated >= 2);
533 }
534
535 #[test]
536 fn test_config_from_env() {

Callers

nothing calls this directly

Calls 3

get_pooled_bufferFunction · 0.85
global_buffer_poolFunction · 0.85
get_statsMethod · 0.45

Tested by

no test coverage detected