OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 private: | 61 private: |
62 class Node { | 62 class Node { |
63 USING_FAST_MALLOC(LinkedStack::Node); | 63 USING_FAST_MALLOC(LinkedStack::Node); |
64 public: | 64 public: |
65 Node(const T&, PassOwnPtr<Node> next); | 65 Node(const T&, PassOwnPtr<Node> next); |
66 | 66 |
67 T m_data; | 67 T m_data; |
68 OwnPtr<Node> m_next; | 68 OwnPtr<Node> m_next; |
69 }; | 69 }; |
70 #if COMPILER(MSVC) | |
71 friend struct ::WTF::OwnedPtrDeleter<Node>; | |
72 #endif | |
73 | 70 |
74 OwnPtr<Node> m_head; | 71 OwnPtr<Node> m_head; |
75 size_t m_size; | 72 size_t m_size; |
76 }; | 73 }; |
77 | 74 |
78 template <typename T> | 75 template <typename T> |
79 LinkedStack<T>::Node::Node(const T& data, PassOwnPtr<Node> next) | 76 LinkedStack<T>::Node::Node(const T& data, PassOwnPtr<Node> next) |
80 : m_data(data) | 77 : m_data(data) |
81 , m_next(next) | 78 , m_next(next) |
82 { | 79 { |
(...skipping 30 matching lines...) Expand all Loading... |
113 inline size_t LinkedStack<T>::size() | 110 inline size_t LinkedStack<T>::size() |
114 { | 111 { |
115 return m_size; | 112 return m_size; |
116 } | 113 } |
117 | 114 |
118 } // namespace WTF | 115 } // namespace WTF |
119 | 116 |
120 using WTF::LinkedStack; | 117 using WTF::LinkedStack; |
121 | 118 |
122 #endif | 119 #endif |
OLD | NEW |