%PDF- %PDF-
Direktori : /usr/local/lib/perl5/site_perl/mach/5.32/sys/ |
Current File : //usr/local/lib/perl5/site_perl/mach/5.32/sys/pctrie.ph |
require '_h2ph_pre.ph'; no warnings qw(redefine misc); unless(defined(&_SYS_PCTRIE_H_)) { eval 'sub _SYS_PCTRIE_H_ () {1;}' unless defined(&_SYS_PCTRIE_H_); require 'sys/_pctrie.ph'; require 'sys/_smr.ph'; if(defined(&_KERNEL)) { eval 'sub PCTRIE_DEFINE_SMR { my($name, $type, $field, $allocfn, $freefn, $smr) = @_; eval q( &PCTRIE_DEFINE($name, $type, $field, $allocfn, $freefn) &static &__inline \'struct type\' * $name &_PCTRIE_LOOKUP_UNLOCKED(\'struct pctrie\' * &ptree, &uint64_t &key) { &return $name &_PCTRIE_VAL2PTR( &pctrie_lookup_unlocked( &ptree, &key, ($smr))); }); }' unless defined(&PCTRIE_DEFINE_SMR); eval 'sub PCTRIE_DEFINE { my($name, $type, $field, $allocfn, $freefn) = @_; eval q( &CTASSERT($sizeof{(0)->$field} == $sizeof{ &uint64_t}); &CTASSERT(( &__offsetof(\'struct type\', $field) & ($sizeof{ &uint32_t} - 1)) == 0); &static &__inline \'struct type\' * $name &_PCTRIE_VAL2PTR( &uint64_t * &val) { &if ( &val == &NULL) &return ( &NULL); &return (( &uintptr_t) &val - &__offsetof(\'struct type\', $field)); } &static &__inline &uint64_t * $name &_PCTRIE_PTR2VAL(\'struct type\' * &ptr) { &return ($ptr->{field}); } &static &__inline \'int\' $name &_PCTRIE_INSERT(\'struct pctrie\' * &ptree, \'struct type\' * &ptr) { &return &pctrie_insert( &ptree, $name &_PCTRIE_PTR2VAL( &ptr), $allocfn); } &static &__inline \'struct type\' * $name &_PCTRIE_LOOKUP(\'struct pctrie\' * &ptree, &uint64_t &key) { &return $name &_PCTRIE_VAL2PTR( &pctrie_lookup( &ptree, &key)); } &static &__inline &__unused \'struct type\' * $name &_PCTRIE_LOOKUP_LE(\'struct pctrie\' * &ptree, &uint64_t &key) { &return $name &_PCTRIE_VAL2PTR( &pctrie_lookup_le( &ptree, &key)); } &static &__inline &__unused \'struct type\' * $name &_PCTRIE_LOOKUP_GE(\'struct pctrie\' * &ptree, &uint64_t &key) { &return $name &_PCTRIE_VAL2PTR( &pctrie_lookup_ge( &ptree, &key)); } &static &__inline &__unused &void $name &_PCTRIE_RECLAIM(\'struct pctrie\' * &ptree) { &pctrie_reclaim_allnodes( &ptree, $freefn); } &static &__inline &void $name &_PCTRIE_REMOVE(\'struct pctrie\' * &ptree, &uint64_t &key) { &pctrie_remove( &ptree, &key, $freefn); }); }' unless defined(&PCTRIE_DEFINE); eval 'sub pctrie_init { my($ptree) = @_; eval q({ ($ptree->{pt_root}) = 0; }); }' unless defined(&pctrie_init); eval 'sub pctrie_is_empty { my($ptree) = @_; eval q({ ( ($ptree->{pt_root}) == 0); }); }' unless defined(&pctrie_is_empty); if(defined(&__LP64__)) { eval 'sub PCTRIE_WIDTH () {4;}' unless defined(&PCTRIE_WIDTH); } else { eval 'sub PCTRIE_WIDTH () {3;}' unless defined(&PCTRIE_WIDTH); } eval 'sub PCTRIE_COUNT () {(1<< &PCTRIE_WIDTH);}' unless defined(&PCTRIE_COUNT); } } 1;