live
     =ˆÎ�þBùVnRÉÜcüÿÝ414ÜÍ¾Ù ž    =/*
 * Copyright (c) 2014 Glen Fernandes
 *
 * Distributed under the Boost Software License, Version 1.0. (See
 * accompanying file LICENSE_1_0.txt or copy at
 * http://www.boost.org/LICENSE_1_0.txt)
 */

#ifndef BOOST_CHECKED_DELETE_HPP
#define BOOST_CHECKED_DELETE_HPP

// The header file at this path is deprecated;
// use boost/core/checked_delete.hpp instead.

#include <boost/core/checked_delete.hpp>

#endif
  <   ?ˆl–Ðz¾”ŠC]ŠqAãO\ŠbÑ¿ŽþD%œh²`nVÊð?ŸÞ34Ý_‡I|¥ŠèªÀÛ  "    ?_ldap
ldap
ldapurl
ldif
slapdtest
  6   Aˆl–Ðz¾”Êe¶…4 Y¸'n6Ê˜´o�þC!YÀ’28ÆÓÍùàƒuÁßÚÁÜ Æ    A#ifndef SRC_ALIASED_BUFFER_INL_H_
#define SRC_ALIASED_BUFFER_INL_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "aliased_buffer.h"
#include "util-inl.h"

namespace node {

typedef size_t AliasedBufferIndex;

template <typename NativeT, typename V8T>
AliasedBufferBase<NativeT, V8T>::AliasedBufferBase(
    v8::Isolate* isolate, const size_t count, const AliasedBufferIndex* index)
    : isolate_(isolate), count_(count), byte_offset_(0), index_(index) {
  CHECK_GT(count, 0);
  if (index != nullptr) {
    // Will be deserialized later.
    return;
  }
  const v8::HandleScope handle_scope(isolate_);
  const size_t size_in_bytes =
      MultiplyWithOverflowCheck(sizeof(NativeT), count);

  // allocate v8 ArrayBuffer
  v8::Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(isolate_, size_in_bytes);
  buffer_ = static_cast<NativeT*>(ab->Data());

  // allocate v8 TypedArray
  v8::Local<V8T> js_array = V8T::New(ab, byte_offset_, count);
  js_array_ = v8::Global<V8T>(isolate, js_array);
}

template <typename NativeT, typename V8T>
AliasedBufferBase<NativeT, V8T>::AliasedBufferBase(
    v8::Isolate* isolate,
    const size_t byte_offset,
    const size_t count,
    const AliasedBufferBase<uint8_t, v8::Uint8Array>& backing_buffer,
    const AliasedBufferIndex* index)
    : isolate_(isolate),
      count_(count),
      byte_offset_(byte_offset),
      index_(index) {
  if (index != nullptr) {
    // Will be deserialized later.
    return;
  }
  const v8::HandleScope handle_scope(isolate_);
  v8::Local<v8::ArrayBuffer> ab = backing_buffer.GetArrayBuffer();

  // validate that the byte_offset is aligned with sizeof(NativeT)
  CHECK_EQ(byte_offset & (sizeof(NativeT) - 1), 0);
  // validate this fits inside the backing buffer
  CHECK_LE(MultiplyWithOverflowCheck(sizeof(NativeT), count),
           ab->ByteLength() - byte_offset);

  buffer_ = reinterpret_cast<NativeT*>(
      const_cast<uint8_t*>(backing_buffer.GetNativeBuffer() + byte_offset));

  v8::Local<V8T> js_array = V8T::New(ab, byte_offset, count);
  js_array_ = v8::Global<V8T>(isolate, js_array);
}

template <typename NativeT, typename V8T>
AliasedBufferBase<NativeT, V8T>::AliasedBufferBase(
    const AliasedBufferBase& that)
    : isolate_(that.isolate_),
      count_(that.count_),
      byte_offset_(that.byte_offset_),
      buffer_(that.buffer_) {
  DCHECK_NULL(index_);
  js_array_ = v8::Global<V8T>(that.isolate_, that.GetJSArray());
}

template <typename NativeT, typename V8T>
AliasedBufferIndex AliasedBufferBase<NativeT, V8T>::Serialize(
    v8::Local<v8::Context> context, v8::SnapshotCreator* creator) {
  DCHECK_NULL(index_);
  return creator->AddData(context, GetJSArray());
}

template <typename NativeT, typename V8T>
inline void AliasedBufferBase<NativeT, V8T>::Deserialize(
    v8::Local<v8::Context> context) {
  DCHECK_NOT_NULL(index_);
  v8::Local<V8T> arr =
      context->GetDataFromSnapshotOnce<V8T>(*index_).ToLocalChecked();
  // These may not hold true for AliasedBuffers that have grown, so should
  // be removed when we expand the snapshot support.
  DCHECK_EQ(count_, arr->Length());
  DCHECK_EQ(byte_offset_, arr->ByteOffset());
  uint8_t* raw = static_cast<uint8_t*>(arr->Buffer()->Data());
  buffer_ = reinterpret_cast<NativeT*>(raw + byte_offset_);
  js_array_.Reset(isolate_, arr);
  index_ = nullptr;
}

template <typename NativeT, typename V8T>
AliasedBufferBase<NativeT, V8T>& AliasedBufferBase<NativeT