mirror of
https://github.com/danog/ext-php-rs.git
synced 2024-11-30 04:39:04 +01:00
chore: deps upgrade (#242)
This commit is contained in:
parent
63a76846d2
commit
eaab5f0694
@ -12,10 +12,10 @@ categories = ["api-bindings"]
|
||||
exclude = ["/.github", "/.crates", "/guide"]
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.2.1"
|
||||
parking_lot = "0.12.1"
|
||||
bitflags = "2"
|
||||
parking_lot = "0.12"
|
||||
cfg-if = "1.0"
|
||||
once_cell = "1.8.0"
|
||||
once_cell = "1.17"
|
||||
anyhow = { version = "1", optional = true }
|
||||
ext-php-rs-derive = { version = "=0.10.0", path = "./crates/macros" }
|
||||
|
||||
|
21
src/flags.rs
21
src/flags.rs
@ -28,6 +28,7 @@ use crate::error::{Error, Result};
|
||||
|
||||
bitflags! {
|
||||
/// Flags used for setting the type of Zval.
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
|
||||
pub struct ZvalTypeFlags: u32 {
|
||||
const Undef = IS_UNDEF;
|
||||
const Null = IS_NULL;
|
||||
@ -45,13 +46,13 @@ bitflags! {
|
||||
const Void = IS_VOID;
|
||||
const Ptr = IS_PTR;
|
||||
|
||||
const InternedStringEx = Self::String.bits;
|
||||
const StringEx = Self::String.bits | Self::RefCounted.bits;
|
||||
const ArrayEx = Self::Array.bits | Self::RefCounted.bits | Self::Collectable.bits;
|
||||
const ObjectEx = Self::Object.bits | Self::RefCounted.bits | Self::Collectable.bits;
|
||||
const ResourceEx = Self::Resource.bits | Self::RefCounted.bits;
|
||||
const ReferenceEx = Self::Reference.bits | Self::RefCounted.bits;
|
||||
const ConstantAstEx = Self::ConstantExpression.bits | Self::RefCounted.bits;
|
||||
const InternedStringEx = Self::String.bits();
|
||||
const StringEx = Self::String.bits() | Self::RefCounted.bits();
|
||||
const ArrayEx = Self::Array.bits() | Self::RefCounted.bits() | Self::Collectable.bits();
|
||||
const ObjectEx = Self::Object.bits() | Self::RefCounted.bits() | Self::Collectable.bits();
|
||||
const ResourceEx = Self::Resource.bits() | Self::RefCounted.bits();
|
||||
const ReferenceEx = Self::Reference.bits() | Self::RefCounted.bits();
|
||||
const ConstantAstEx = Self::ConstantExpression.bits() | Self::RefCounted.bits();
|
||||
|
||||
const RefCounted = (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT);
|
||||
const Collectable = (IS_TYPE_COLLECTABLE << Z_TYPE_FLAGS_SHIFT);
|
||||
@ -60,6 +61,7 @@ bitflags! {
|
||||
|
||||
bitflags! {
|
||||
/// Flags for building classes.
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
|
||||
pub struct ClassFlags: u32 {
|
||||
const Final = ZEND_ACC_FINAL;
|
||||
const Abstract = ZEND_ACC_ABSTRACT;
|
||||
@ -91,6 +93,7 @@ bitflags! {
|
||||
|
||||
bitflags! {
|
||||
/// Flags for building methods.
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
|
||||
pub struct MethodFlags: u32 {
|
||||
const Public = ZEND_ACC_PUBLIC;
|
||||
const Protected = ZEND_ACC_PROTECTED;
|
||||
@ -126,6 +129,7 @@ bitflags! {
|
||||
|
||||
bitflags! {
|
||||
/// Flags for building properties.
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
|
||||
pub struct PropertyFlags: u32 {
|
||||
const Public = ZEND_ACC_PUBLIC;
|
||||
const Protected = ZEND_ACC_PROTECTED;
|
||||
@ -138,6 +142,7 @@ bitflags! {
|
||||
|
||||
bitflags! {
|
||||
/// Flags for building constants.
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
|
||||
pub struct ConstantFlags: u32 {
|
||||
const Public = ZEND_ACC_PUBLIC;
|
||||
const Protected = ZEND_ACC_PROTECTED;
|
||||
@ -148,6 +153,7 @@ bitflags! {
|
||||
|
||||
bitflags! {
|
||||
/// Flags for building module global constants.
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
|
||||
pub struct GlobalConstantFlags: u32 {
|
||||
const CaseSensitive = CONST_CS;
|
||||
const Persistent = CONST_PERSISTENT;
|
||||
@ -158,6 +164,7 @@ bitflags! {
|
||||
|
||||
bitflags! {
|
||||
/// Represents the result of a function.
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
|
||||
pub struct ZendResult: i32 {
|
||||
const Success = 0;
|
||||
const Failure = -1;
|
||||
|
@ -555,7 +555,7 @@ impl Zval {
|
||||
// SAFETY: If the value if refcounted (`self.u1.type_info & Z_TYPE_FLAGS_MASK`)
|
||||
// then it is valid to dereference `self.value.counted`.
|
||||
unsafe {
|
||||
let flags = ZvalTypeFlags::from_bits_unchecked(self.u1.type_info);
|
||||
let flags = ZvalTypeFlags::from_bits_retain(self.u1.type_info);
|
||||
if flags.contains(ZvalTypeFlags::RefCounted) {
|
||||
(*self.value.counted).gc.refcount += 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user