1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef STACK_ALLOCATED_H_
6 #define STACK_ALLOCATED_H_
8 #include "heap/stubs.h"
15 DISALLOW_ALLOCATION();
17 Member
<HeapObject
> m_obj
; // Needs tracing.
23 Member
<HeapObject
> m_obj
; // Does not need tracing.
26 class AnotherStackObject
: public PartObject
{ // Invalid base.
29 StackObject m_part
; // Can embed a stack allocated object.
32 class HeapObject
: public GarbageCollected
<HeapObject
> {
36 StackObject m_part
; // Cannot embed a stack allocated object.
39 // STACK_ALLOCATED is inherited.
40 class DerivedStackObject
: public StackObject
{
42 AnotherStackObject m_anotherPart
; // Also fine.