chromium/v8/samples/cppgc/hello-world.cc

// 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.

#include <iostream>
#include <memory>
#include <string>

#include "include/cppgc/allocation.h"
#include "include/cppgc/default-platform.h"
#include "include/cppgc/garbage-collected.h"
#include "include/cppgc/heap.h"
#include "include/cppgc/member.h"
#include "include/cppgc/visitor.h"

#if !CPPGC_IS_STANDALONE
#include "include/v8-initialization.h"
#endif  // !CPPGC_IS_STANDALONE

/**
 * This sample program shows how to set up a stand-alone cppgc heap.
 */

/**
 * Simple string rope to illustrate allocation and garbage collection below.
 * The rope keeps the next parts alive via regular managed reference.
 */
class Rope final : public cppgc::GarbageCollected<Rope> {};

int main(int argc, char* argv[]) {}