GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — node/src/aliased_struct-inl.h at master · mark-scott/node Expand file tree/ Copy pathaliased_struct-inl.hMore file actions 54 lines (40 loc) · 1.32 KB / Copy pathaliased_struct-inl.hFile metadata and controls54 lines (40 loc) · 1.32 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 #ifndef SRC_ALIASED_STRUCT_INL_H_ #define SRC_ALIASED_STRUCT_INL_H_ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "aliased_struct.h" #include "v8.h" #include <memory> namespace node { template <typename T> template <typename... Args> AliasedStruct<T>::AliasedStruct(v8::Isolate* isolate, Args&&... args) : isolate_(isolate) { const v8::HandleScope handle_scope(isolate); store_ = v8::ArrayBuffer::NewBackingStore(isolate, sizeof(T)); ptr_ = new (store_->Data()) T(std::forward<Args>(args)...); DCHECK_NOT_NULL(ptr_); v8::Local<v8::ArrayBuffer> buffer = v8::ArrayBuffer::New(isolate, store_); buffer_ = v8::Global<v8::ArrayBuffer>(isolate, buffer); } template <typename T> AliasedStruct<T>::AliasedStruct(const AliasedStruct& that) : AliasedStruct(that.isolate_, *that) {} template <typename T> AliasedStruct<T>& AliasedStruct<T>::operator=( AliasedStruct<T>&& that) noexcept { this->~AliasedStruct(); isolate_ = that.isolate_; store_ = that.store_; ptr_ = that.ptr_; buffer_ = std::move(that.buffer_); that.ptr_ = nullptr; that.store_.reset(); return *this; } template <typename T> AliasedStruct<T>::~AliasedStruct() { if (ptr_ != nullptr) ptr_->~T(); } } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #endif // SRC_ALIASED_STRUCT_INL_H_ |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |