GIF89; GIF89; %PDF- %PDF-
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef INCLUDE_CPPGC_GARBAGE_COLLECTED_H_
#define INCLUDE_CPPGC_GARBAGE_COLLECTED_H_
#include "cppgc/internal/api-constants.h"
#include "cppgc/platform.h"
#include "cppgc/trace-trait.h"
#include "cppgc/type-traits.h"
namespace cppgc {
class Visitor;
/**
* Base class for managed objects. Only descendent types of `GarbageCollected`
* can be constructed using `MakeGarbageCollected()`. Must be inherited from as
* left-most base class.
*
* Types inheriting from GarbageCollected must provide a method of
* signature `void Trace(cppgc::Visitor*) const` that dispatchs all managed
* pointers to the visitor and delegates to garbage-collected base classes.
* The method must be virtual if the type is not directly a child of
* GarbageCollected and marked as final.
*
* \code
* // Example using final class.
* class FinalType final : public GarbageCollected<FinalType> {
* public:
* void Trace(cppgc::Visitor* visitor) const {
* // Dispatch using visitor->Trace(...);
* }
* };
*
* // Example using non-final base class.
* class NonFinalBase : public GarbageCollected<NonFinalBase> {
* public:
* virtual void Trace(cppgc::Visitor*) const {}
* };
*
* class FinalChild final : public NonFinalBase {
* public:
* void Trace(cppgc::Visitor* visitor) const final {
* // Dispatch using visitor->Trace(...);
* NonFinalBase::Trace(visitor);
* }
* };
* \endcode
*/
template <typename T>
class GarbageCollected {
public:
using IsGarbageCollectedTypeMarker = void;
using ParentMostGarbageCollectedType = T;
// Must use MakeGarbageCollected.
void* operator new(size_t) = delete;
void* operator new[](size_t) = delete;
// The garbage collector is taking care of reclaiming the object. Also,
// virtual destructor requires an unambiguous, accessible 'operator delete'.
void operator delete(void*) {
#ifdef V8_ENABLE_CHECKS
internal::Fatal(
"Manually deleting a garbage collected object is not allowed");
#endif // V8_ENABLE_CHECKS
}
void operator delete[](void*) = delete;
protected:
GarbageCollected() = default;
};
/**
* Base class for managed mixin objects. Such objects cannot be constructed
* directly but must be mixed into the inheritance hierarchy of a
* GarbageCollected object.
*
* Types inheriting from GarbageCollectedMixin must override a virtual method
* of signature `void Trace(cppgc::Visitor*) const` that dispatchs all managed
* pointers to the visitor and delegates to base classes.
*
* \code
* class Mixin : public GarbageCollectedMixin {
* public:
* void Trace(cppgc::Visitor* visitor) const override {
* // Dispatch using visitor->Trace(...);
* }
* };
* \endcode
*/
class GarbageCollectedMixin {
public:
using IsGarbageCollectedMixinTypeMarker = void;
/**
* This Trace method must be overriden by objects inheriting from
* GarbageCollectedMixin.
*/
virtual void Trace(cppgc::Visitor*) const {}
};
} // namespace cppgc
#endif // INCLUDE_CPPGC_GARBAGE_COLLECTED_H_
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| internal | Folder | 0755 |
|
|
| allocation.h | File | 11.61 KB | 0644 |
|
| common.h | File | 643 B | 0644 |
|
| cross-thread-persistent.h | File | 14.81 KB | 0644 |
|
| custom-space.h | File | 2.4 KB | 0644 |
|
| default-platform.h | File | 2.18 KB | 0644 |
|
| ephemeron-pair.h | File | 804 B | 0644 |
|
| explicit-management.h | File | 3.29 KB | 0644 |
|
| garbage-collected.h | File | 3.11 KB | 0644 |
|
| heap-consistency.h | File | 11.74 KB | 0644 |
|
| heap-handle.h | File | 1.26 KB | 0644 |
|
| heap-state.h | File | 2.57 KB | 0644 |
|
| heap-statistics.h | File | 3.89 KB | 0644 |
|
| heap.h | File | 5.7 KB | 0644 |
|
| liveness-broker.h | File | 2.34 KB | 0644 |
|
| macros.h | File | 1.31 KB | 0644 |
|
| member.h | File | 23.55 KB | 0644 |
|
| name-provider.h | File | 1.99 KB | 0644 |
|
| object-size-trait.h | File | 1.6 KB | 0644 |
|
| persistent.h | File | 13.61 KB | 0644 |
|
| platform.h | File | 5.9 KB | 0644 |
|
| prefinalizer.h | File | 2.88 KB | 0644 |
|
| process-heap-statistics.h | File | 1009 B | 0644 |
|
| sentinel-pointer.h | File | 1.18 KB | 0644 |
|
| source-location.h | File | 414 B | 0644 |
|
| testing.h | File | 2.96 KB | 0644 |
|
| trace-trait.h | File | 3.4 KB | 0644 |
|
| type-traits.h | File | 8.45 KB | 0644 |
|
| visitor.h | File | 18.08 KB | 0644 |
|