view release on metacpan or search on metacpan
#include "buf_str.h"
#include "XSParseKeyword.h"
/* ---- as_scalar magic: prevent use-after-free by preventing buffer DESTROY
* while the returned scalar ref is alive. We attach magic to the inner SV
* that holds a reference to the buffer object. When the inner SV is freed,
* the magic destructor releases the reference. ---- */
static int buf_scalar_magic_free(pTHX_ SV *sv, MAGIC *mg) {
PERL_UNUSED_ARG(sv);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Dump/Streamer.pm view on Meta::CPAN
# from link from [ysth]: http://groups.google.com/groups?selm=laUs8gzkgOlT092yn%40efn.org
# translate arg (or reference to it) into a B::* object
# To work-around perl commit
# 2acc3314e31a9342e325f35c5b592967c9850c9b, keep the
# value \*$lhs alive while we inspect it as a B object
# or else it'll be reaped while we're using it.
my $lhs_glob= \*$lhs;
my $Bobj= B::svref_2object($lhs_glob);
# if passed a glob or globref, get the format
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Edit/Xml.pm view on Meta::CPAN
die "success!"; # Halt the search
}
});
};
confess $@ if $@ and $@ !~ /success!/; # Report any suppressed error messages at this point
$x # Return node found if we are still alive
}
sub firstSibling($@) #CYU Return the first sibling of the specified B<$node> in the optional B<@context> else B<undef>
{my ($node, @context) = @_; # Node, array of tags specifying context.
return undef if @context and !$node->at(@context); # Not in specified context
lib/Data/Edit/Xml.pm view on Meta::CPAN
die "success!"; # Halt the search
}
});
};
confess $@ if $@ and $@ !~ /success!/; # Report any suppressed error messages at this point
$x # Return node found if we are still alive
}
sub lastSibling($@) #CYU Return the last sibling of the specified B<$node> in the optional B<@context> else B<undef>
{my ($node, @context) = @_; # Node, array of tags specifying context.
return undef if @context and !$node->at(@context); # Not in specified context
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/FR/Town.pm view on Meta::CPAN
21574;;Saint-Seine-sur-Vingeanne;SAINT-SEINE-SUR-VINGEANNE;21610;21;COTE D'OR;1
21575;;Saint-Symphorien-sur-Saône;SAINT-SYMPHORIEN-SUR-SAONE;21170;21;COTE D'OR;1
21576;;Saint-Thibault;SAINT-THIBAULT;21350;21;COTE D'OR;1
21577;;Saint-Usage;SAINT-USAGE;21170;21;COTE D'OR;1
21578;;Saint-Victor-sur-Ouche;SAINT-VICTOR-SUR-OUCHE;21410;21;COTE D'OR;1
21579;;Salives;SALIVES;21580;21;COTE D'OR;1
21580;;Salmaise;SALMAISE;21690;21;COTE D'OR;1
21581;;Samerey;SAMEREY;21170;21;COTE D'OR;1
21582;;Santenay;SANTENAY;21590;21;COTE D'OR;1
21583;;Santosse;SANTOSSE;21340;21;COTE D'OR;1
21584;;Saulieu;SAULIEU;21210;21;COTE D'OR;1
lib/Data/FR/Town.pm view on Meta::CPAN
33535;;Tresses;TRESSES;33370;33;GIRONDE;1
33536;Le;Tuzan;TUZAN;33125;33;GIRONDE;1
33537;;Uzeste;UZESTE;33730;33;GIRONDE;1
33538;;Valeyrac;VALEYRAC;33340;33;GIRONDE;1
33539;;Vayres;VAYRES;33870;33;GIRONDE;1
33540;;Vendays-Montalivet;VENDAYS-MONTALIVET;33930;33;GIRONDE;1
33541;;Vensac;VENSAC;33590;33;GIRONDE;1
33542;;Vérac;VERAC;33240;33;GIRONDE;1
33543;;Verdelais;VERDELAIS;33490;33;GIRONDE;1
33544;Le;Verdon-sur-Mer;VERDON-SUR-MER;33123;33;GIRONDE;1
33545;;Vertheuil;VERTHEUIL;33180;33;GIRONDE;1
view all matches for this distribution
view release on metacpan or search on metacpan
* Mutex (same pattern as Heap)
* ================================================================ */
static const struct timespec graph_lock_timeout = { 2, 0 };
static inline int graph_pid_alive(uint32_t pid) {
if (pid == 0) return 1;
return !(kill((pid_t)pid, 0) == -1 && errno == ESRCH);
}
static inline void graph_mutex_lock(GraphHeader *hdr) {
if (cur != 0) {
long rc = syscall(SYS_futex, &hdr->mutex, FUTEX_WAIT, cur,
&graph_lock_timeout, NULL, 0);
if (rc == -1 && errno == ETIMEDOUT && cur >= GRAPH_MUTEX_BIT) {
uint32_t pid = cur & GRAPH_MUTEX_PID;
if (!graph_pid_alive(pid) &&
__atomic_compare_exchange_n(&hdr->mutex, &cur, 0,
0, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED)) {
/* Recovered â wake one waiter so it can proceed. */
syscall(SYS_futex, &hdr->mutex, FUTEX_WAKE, 1, NULL, NULL, 0);
}
view all matches for this distribution
view release on metacpan or search on metacpan
my $v = shm_si_get $map, "counter";
printf "counter=%s (expired: %s)\n", $v // 'undef', defined $v ? 'no' : 'yes';
my $p = shm_si_get $map, "permanent";
printf "permanent=%s (still alive)\n", $p;
$map->unlink;
view all matches for this distribution
view release on metacpan or search on metacpan
sleep 1;
# Re-put refreshes TTL
hm_ii_put $m, 1, 20;
sleep 2;
# 3 seconds since original put, but only 2 since refresh (TTL=3)
is(hm_ii_get $m, 1, 20, 'TTL: put refresh keeps entry alive');
}
# ---- Iteration skips expired entries ----
{
view all matches for this distribution
view release on metacpan or search on metacpan
* Mutex (PID-based, stale-recoverable)
* ================================================================ */
static const struct timespec heap_lock_timeout = { 2, 0 };
static inline int heap_pid_alive(uint32_t pid) {
if (pid == 0) return 1;
return !(kill((pid_t)pid, 0) == -1 && errno == ESRCH);
}
static inline void heap_mutex_lock(HeapHeader *hdr) {
if (cur != 0) {
long rc = syscall(SYS_futex, &hdr->mutex, FUTEX_WAIT, cur,
&heap_lock_timeout, NULL, 0);
if (rc == -1 && errno == ETIMEDOUT && cur >= HEAP_MUTEX_BIT) {
uint32_t pid = cur & HEAP_MUTEX_PID;
if (!heap_pid_alive(pid)) {
if (__atomic_compare_exchange_n(&hdr->mutex, &cur, 0,
0, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED)) {
__atomic_add_fetch(&hdr->stat_recoveries, 1, __ATOMIC_RELAXED);
/* Wake one waiter so recovery latency is not bounded by the 2s timeout. */
if (__atomic_load_n(&hdr->mutex_waiters, __ATOMIC_RELAXED) > 0)
view all matches for this distribution
view release on metacpan or search on metacpan
msgpack-3.3.0/README view on Meta::CPAN
msgpack_pack_true(&pk);
msgpack_pack_str(&pk, 7);
msgpack_pack_str_body(&pk, "example", 7);
/* deserialize the buffer into msgpack_object instance. */
/* deserialized object is valid during the msgpack_zone instance alive. */
msgpack_zone mempool;
msgpack_zone_init(&mempool, 2048);
msgpack_object deserialized;
msgpack_unpack(sbuf.data, sbuf.size, NULL, &mempool, &deserialized);
msgpack-3.3.0/README view on Meta::CPAN
std::string str(buffer.str());
msgpack::object_handle oh =
msgpack::unpack(str.data(), str.size());
// deserialized object is valid during the msgpack::object_handle instance is alive.
msgpack::object deserialized = oh.get();
// msgpack::object supports ostream.
std::cout << deserialized << std::endl;
view all matches for this distribution
view release on metacpan or search on metacpan
share/dictionary.txt view on Meta::CPAN
alike
alimentary
alimony
alimony's
alit
alive
alkali
alkali's
alkalies
alkaline
alkalinity
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Password/Top10000.pm view on Meta::CPAN
bambi
babycake
aprilia
ANDREW
allgood
alive
adriano
808080
7777777a
777666
31121986
view all matches for this distribution
view release on metacpan or search on metacpan
src/passwdqc/wordset_4k.c view on Meta::CPAN
"alibi",
"alien",
"alight",
"align",
"alike",
"alive",
"alkali",
"all",
"alley",
"allied",
"allow",
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Password/zxcvbn/RankedDictionaries/French.pm view on Meta::CPAN
'alimenter' => 8872,
'alimentes' => 12163,
'aliments' => 5511,
'alinea' => 16706,
'alite' => 27647,
'alive' => 21499,
'aliyev' => 27648,
'allah' => 16050,
'allaient' => 6760,
'allait' => 2746,
'allant' => 1737,
lib/Data/Password/zxcvbn/RankedDictionaries/French.pm view on Meta::CPAN
'saline' => 19168,
'salines' => 17653,
'salinite' => 19508,
'salins' => 19509,
'salisbury' => 21860,
'salive' => 22319,
'salle' => 427,
'sally' => 12026,
'salon' => 1565,
'salonique' => 24548,
'salons' => 5543,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Password/zxcvbn/RankedDictionaries/German.pm view on Meta::CPAN
'alice' => 4230,
'alicia' => 26309,
'alien' => 26310,
'aliens' => 19863,
'alison' => 19144,
'alive' => 20299,
'alkohol' => 4344,
'alkoholgehalt' => 27985,
'alkoholiker' => 23131,
'alkoholkonsum' => 27986,
'allah' => 24963,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Password/zxcvbn/RankedDictionaries/English.pm view on Meta::CPAN
'aliens' => 2024,
'alight' => 18559,
'alike' => 2174,
'alimony' => 6443,
'alistair' => 2423,
'alive' => 435,
'all' => 25,
'allah' => 5270,
'allahu' => 18558,
'allegiances' => 21432,
'alleluia' => 16553,
view all matches for this distribution
view release on metacpan or search on metacpan
eg/guard.pl view on Meta::CPAN
my $guard = $pool->alloc_guard;
printf "scalar guard: used = %d\n", $pool->used;
}
printf "after scalar guard: used = %d\n\n", $pool->used;
# try_alloc_guard â fill pool, guards keep slots alive
my @guards;
for (1..4) {
my ($idx, $guard) = $pool->try_alloc_guard;
printf "try_alloc_guard: %s (used=%d)\n",
defined $idx ? "slot $idx" : "full", $pool->used;
view all matches for this distribution
view release on metacpan or search on metacpan
#define PUBSUB_MUTEX_WRITER_BIT 0x80000000U
#define PUBSUB_MUTEX_PID_MASK 0x7FFFFFFFU
#define PUBSUB_MUTEX_VAL(pid) (PUBSUB_MUTEX_WRITER_BIT | ((uint32_t)(pid) & PUBSUB_MUTEX_PID_MASK))
static inline int pubsub_pid_alive(uint32_t pid) {
if (pid == 0) return 1;
return !(kill((pid_t)pid, 0) == -1 && errno == ESRCH);
}
static const struct timespec pubsub_lock_timeout = { PUBSUB_LOCK_TIMEOUT_SEC, 0 };
if (rc == -1 && errno == ETIMEDOUT) {
__atomic_sub_fetch(&hdr->mutex_waiters, 1, __ATOMIC_RELAXED);
uint32_t val = __atomic_load_n(&hdr->mutex, __ATOMIC_RELAXED);
if (val >= PUBSUB_MUTEX_WRITER_BIT) {
uint32_t pid = val & PUBSUB_MUTEX_PID_MASK;
if (!pubsub_pid_alive(pid))
pubsub_recover_stale_mutex(hdr, val);
}
spin = 0;
continue;
}
view all matches for this distribution
view release on metacpan or search on metacpan
#define QUEUE_MUTEX_WRITER_BIT 0x80000000U
#define QUEUE_MUTEX_PID_MASK 0x7FFFFFFFU
#define QUEUE_MUTEX_VAL(pid) (QUEUE_MUTEX_WRITER_BIT | ((uint32_t)(pid) & QUEUE_MUTEX_PID_MASK))
static inline int queue_pid_alive(uint32_t pid) {
if (pid == 0) return 1;
return !(kill((pid_t)pid, 0) == -1 && errno == ESRCH);
}
static const struct timespec queue_lock_timeout = { QUEUE_LOCK_TIMEOUT_SEC, 0 };
if (rc == -1 && errno == ETIMEDOUT) {
__atomic_sub_fetch(&hdr->mutex_waiters, 1, __ATOMIC_RELAXED);
uint32_t val = __atomic_load_n(&hdr->mutex, __ATOMIC_RELAXED);
if (val >= QUEUE_MUTEX_WRITER_BIT) {
uint32_t pid = val & QUEUE_MUTEX_PID_MASK;
if (!queue_pid_alive(pid))
queue_recover_stale_mutex(hdr, val);
}
spin = 0;
continue;
}
view all matches for this distribution
view release on metacpan or search on metacpan
radius/laurel view on Meta::CPAN
ATTRIBUTE Laurel-PPPOE-Session-Limit 152 integer
ATTRIBUTE Laurel-PPPOE-Src-MAC-Validation 153 integer
ATTRIBUTE Laurel-PPP-Authentication 154 integer
ATTRIBUTE Laurel-CHAP-Challenge-Interval 155 integer
ATTRIBUTE Laurel-CHAP-Retries 157 integer
ATTRIBUTE Laurel-PPP-Keepalives 158 integer
ATTRIBUTE Laurel-Magic-Number 159 integer
ATTRIBUTE Laurel-Maximum-Receive-Unit 160 integer
ATTRIBUTE Laurel-Domain-Filter 161 string
ATTRIBUTE Laurel-DHCP 168 integer
ATTRIBUTE Laurel-DHCP-Host-Limit 169 integer
radius/laurel view on Meta::CPAN
VALUE Laurel-PPP-Authentication PAP 1
VALUE Laurel-PPP-Authentication CHAP 2
VALUE Laurel-PPP-Authentication PAP-then-CHAP 3
VALUE Laurel-PPP-Authentication CHAP-then-PAP 4
VALUE Laurel-PPP-Keepalives Disable 0
VALUE Laurel-PPP-Keepalives Enable 1
VALUE Laurel-PPPOE-Src-MAC-Validation No 0
VALUE Laurel-PPPOE-Src-MAC-Validation Yes 1
VALUE Laurel-Protocol None 0
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Random/Contact/Language/EN.pm view on Meta::CPAN
alike
alimentary
alimony
alimony's
alit
alive
alkali
alkali's
alkalies
alkaline
alkalinity
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Random/dict view on Meta::CPAN
aliment
aliments
alimony
Alison
Alistair
alive
alkali
alkaline
alkalis
alkaloid
alkaloids
view all matches for this distribution
view release on metacpan or search on metacpan
#define REQREP_MUTEX_WRITER_BIT 0x80000000U
#define REQREP_MUTEX_PID_MASK 0x7FFFFFFFU
#define REQREP_MUTEX_VAL(pid) (REQREP_MUTEX_WRITER_BIT | ((uint32_t)(pid) & REQREP_MUTEX_PID_MASK))
static inline int reqrep_pid_alive(uint32_t pid) {
if (pid == 0) return 1;
return !(kill((pid_t)pid, 0) == -1 && errno == ESRCH);
}
static const struct timespec reqrep_lock_timeout = { REQREP_LOCK_TIMEOUT_SEC, 0 };
if (rc == -1 && errno == ETIMEDOUT) {
__atomic_sub_fetch(&hdr->mutex_waiters, 1, __ATOMIC_RELAXED);
uint32_t val = __atomic_load_n(&hdr->mutex, __ATOMIC_RELAXED);
if (val >= REQREP_MUTEX_WRITER_BIT) {
uint32_t pid = val & REQREP_MUTEX_PID_MASK;
if (!reqrep_pid_alive(pid))
reqrep_recover_stale_mutex(hdr, val);
}
spin = 0;
continue;
}
for (uint32_t i = 0; i < n; i++) {
RespSlotHeader *slot = reqrep_resp_slot(h, i);
uint32_t state = __atomic_load_n(&slot->state, __ATOMIC_ACQUIRE);
if (state != RESP_ACQUIRED && state != RESP_READY) continue;
uint32_t pid = __atomic_load_n(&slot->owner_pid, __ATOMIC_ACQUIRE);
if (!pid || reqrep_pid_alive(pid)) continue;
/* Claim exclusive recovery rights by CASing the dead owner to 0.
* Loser of this race exits â winner of state CAS would have already
* progressed; we can't safely race the state transition. */
uint32_t expected_pid = pid;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Riak/HTTP.pm view on Meta::CPAN
$opts{MaxLineLength} = 0;
@LWP::Protocol::http::EXTRA_SOCK_OPTS = %opts;
my $ua = LWP::UserAgent->new(
timeout => $self->timeout,
keep_alive => 1,
);
$CONN_CACHE ||= LWP::ConnCache->new;
$ua->conn_cache( $CONN_CACHE );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Roundtrip.pm view on Meta::CPAN
EOS
# this is OK also:
# - \"w: 1
my $pv = eval { YAML::Load($yamlstr) };
if( $@ ){ die "failed(1): ". $@ }
# it's OK! still alive.
I have provided an author-only test (C<make deficiencies>) which
tests all three of them on the edge cases. Both L<YAML::PP>
and L<YAML::XS> pass the tests.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/STUID/Generator.pm view on Meta::CPAN
use constant SERIAL_SHIFT => HOST_ID_BITS;
# XXX WHAT ON EARTH ARE YOU DOING HERE?
#
# We normally protect ourselves from leaking resources in DESTROY, but...
# when we are enveloped in a PSGI app, a reference to us stays alive until
# global destruction.
#
# At global destruction time, the order in which objects get cleaned
# up is undefined, so it often happens that the mutex/shared memory gets
# freed before the dispatcher object -- so when DESTROY gets called,
view all matches for this distribution
view release on metacpan or search on metacpan
#else
__asm__ volatile("" ::: "memory");
#endif
}
static inline int sync_pid_alive(uint32_t pid) {
if (pid == 0) return 1;
return !(kill((pid_t)pid, 0) == -1 && errno == ESRCH);
}
/* Convert timeout in seconds (double) to absolute deadline */
if (rc == -1 && errno == ETIMEDOUT) {
__atomic_sub_fetch(&hdr->mutex_waiters, 1, __ATOMIC_RELAXED);
uint32_t val = __atomic_load_n(&hdr->mutex, __ATOMIC_RELAXED);
if (val >= SYNC_MUTEX_WRITER_BIT) {
uint32_t pid = val & SYNC_MUTEX_PID_MASK;
if (!sync_pid_alive(pid))
sync_recover_stale_mutex(hdr, val);
}
spin = 0;
continue;
}
* of the orphan rwlock contribution while a live reader is present. */
for (uint32_t i = 0; i < SYNC_READER_SLOTS; i++) {
uint32_t pid = __atomic_load_n(&h->reader_slots[i].pid, __ATOMIC_ACQUIRE);
if (pid == 0) continue;
uint32_t sc = __atomic_load_n(&h->reader_slots[i].subcount, __ATOMIC_RELAXED);
if (sync_pid_alive(pid)) {
if (sc > 0) any_live_reader = 1;
continue;
}
if (sc > 0) { found_dead_reader = 1; continue; }
if (sync_drain_dead_slot(h, i, pid)) any_recovery = 1;
}
}
for (uint32_t i = 0; i < SYNC_READER_SLOTS; i++) {
uint32_t pid = __atomic_load_n(&h->reader_slots[i].pid, __ATOMIC_ACQUIRE);
if (pid == 0) continue;
if (sync_pid_alive(pid)) continue;
if (sync_drain_dead_slot(h, i, pid)) any_recovery = 1;
}
}
if (any_recovery)
__atomic_add_fetch(&hdr->stat_recoveries, 1, __ATOMIC_RELAXED);
static inline void sync_recover_after_timeout(SyncHandle *h) {
SyncHeader *hdr = h->hdr;
uint32_t val = __atomic_load_n(&hdr->value, __ATOMIC_RELAXED);
if (val >= SYNC_RWLOCK_WRITER_BIT) {
uint32_t pid = val & SYNC_RWLOCK_PID_MASK;
if (!sync_pid_alive(pid))
sync_recover_stale_rwlock(hdr, val);
} else {
sync_recover_dead_readers(h);
}
}
if (val == SYNC_ONCE_INIT) continue; /* race: was reset, retry */
/* Check stale initializer */
if (val >= SYNC_MUTEX_WRITER_BIT) {
uint32_t pid = val & SYNC_MUTEX_PID_MASK;
if (!sync_pid_alive(pid)) {
if (__atomic_compare_exchange_n(&hdr->value, &val, SYNC_ONCE_INIT,
0, __ATOMIC_ACQ_REL, __ATOMIC_RELAXED)) {
__atomic_add_fetch(&hdr->stat_recoveries, 1, __ATOMIC_RELAXED);
if (__atomic_load_n(&hdr->waiters, __ATOMIC_RELAXED) > 0)
syscall(SYS_futex, &hdr->value, FUTEX_WAKE, INT_MAX, NULL, NULL, 0);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/TagDB.pm view on Meta::CPAN
my $dbh = $db->dbh;
Returns the current L<DBI> connection.
This connection can be used to call any transaction independent method on the handle.
It can for example be used to call L<DBI/ping> to keep the connection alive.
If methods are called that depend on the state of the transaction logic
(such as performing an SELECT or UPDATE) the state of the transaction B<must> be managed via
this module. See L</begin_work>.
view all matches for this distribution
view release on metacpan or search on metacpan
t/tersify.t view on Meta::CPAN
# We can tersify a resultset object...
my %data = (
result_set => bless {
_result_class => 'Arbitrary::Class::Name',
attrs => {
Paul => 'alive',
Jessica => 'alive',
Leto => 'dead',
Alia => 'abomination',
},
cond => 'Not even a hashref',
result_source => 'Ignored',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Transform/SSL.pm view on Meta::CPAN
my ($self) = @_;
my %args = ();
if ($self->[TYPE] == TYPE_CLIENT) {
# don't reference $self, so there isn't an extra reference keeping
# it alive too long
my $flags = $self->[FLAGS];
$args{SSL_verify_callback} = sub {
my ($ok, $ctx_store) = @_;
my $cert = Net::SSLeay::X509_STORE_CTX_get_current_cert($ctx_store);
my $error = Net::SSLeay::X509_STORE_CTX_get_error($ctx_store);
view all matches for this distribution