jitcraft/Barriers.h
changeset 28 a9665857cfd5
parent 13 627b6b94e774
child 45 25b995bc75a0
     1.1 --- a/jitcraft/Barriers.h	Mon Jul 02 14:04:29 2012 -0700
     1.2 +++ b/jitcraft/Barriers.h	Mon Jul 02 23:37:12 2012 -0700
     1.3 @@ -1,32 +1,32 @@
     1.4 -/*
     1.5 - * Copyright (C) 2012 David Anderson
     1.6 - *
     1.7 - * This file is part of JITCraft.
     1.8 - *
     1.9 - * JITCraft is free software: you can redistribute it and/or modify it under
    1.10 - * the terms of the GNU General Public License as published by the Free
    1.11 - * Software Foundation, either version 3 of the License, or (at your option)
    1.12 - * any later version.
    1.13 - * 
    1.14 - * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY
    1.15 - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    1.16 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
    1.17 - *
    1.18 - * You should have received a copy of the GNU General Public License along with
    1.19 - * JITCraft. If not, see http://www.gnu.org/licenses/.
    1.20 - */
    1.21 -#ifndef _include_jitcraft_barriers_h_
    1.22 -#define _include_jitcraft_barriers_h_
    1.23 -
    1.24 -class Object;
    1.25 -
    1.26 -namespace jc {
    1.27 -
    1.28 +/*
    1.29 + * Copyright (C) 2012 David Anderson
    1.30 + *
    1.31 + * This file is part of JITCraft.
    1.32 + *
    1.33 + * JITCraft is free software: you can redistribute it and/or modify it under
    1.34 + * the terms of the GNU General Public License as published by the Free
    1.35 + * Software Foundation, either version 3 of the License, or (at your option)
    1.36 + * any later version.
    1.37 + * 
    1.38 + * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY
    1.39 + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    1.40 + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
    1.41 + *
    1.42 + * You should have received a copy of the GNU General Public License along with
    1.43 + * JITCraft. If not, see http://www.gnu.org/licenses/.
    1.44 + */
    1.45 +#ifndef _include_jitcraft_barriers_h_
    1.46 +#define _include_jitcraft_barriers_h_
    1.47 +
    1.48 +class Object;
    1.49 +
    1.50 +namespace jc {
    1.51 +
    1.52  // Used to store unbarriered heap locations.
    1.53  template <typename T>
    1.54  class Unbarriered
    1.55  {
    1.56 -    Object *obj_;
    1.57 +    T *obj_;
    1.58  
    1.59    public:
    1.60      Unbarriered()
    1.61 @@ -53,13 +53,13 @@
    1.62      operator T*() const {
    1.63          return static_cast<T *>(obj_);
    1.64      }
    1.65 -};
    1.66 -
    1.67 +};
    1.68 +
    1.69  // Used to store unbarriered heap locations.
    1.70  template <typename T>
    1.71  class Barriered
    1.72  {
    1.73 -    Object *obj_;
    1.74 +    T *obj_;
    1.75  
    1.76    public:
    1.77      Barriered()
    1.78 @@ -86,8 +86,8 @@
    1.79      operator T*() const {
    1.80          return static_cast<T *>(obj_);
    1.81      }
    1.82 -};
    1.83 -
    1.84 -}
    1.85 -
    1.86 -#endif // _include_jitcraft_barriers_h_
    1.87 +};
    1.88 +
    1.89 +}
    1.90 +
    1.91 +#endif // _include_jitcraft_barriers_h_