<commit_before>/* Copyright 2021 Stanford University, NVIDIA Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// templated intrusive linked lists

#ifndef REALM_LISTS_H
#define REALM_LISTS_H

#include "realm/atomics.h"

#ifdef REALM_ON_WINDOWS
#define REALM_PMTA_DECL(structtype,membertype,name) typename name
#define REALM_PMTA_DEFN(structtype,membertype,name) \
  struct name ## _pmta { static membertype& deref(structtype *obj) { return obj->name; } \
                         static const membertype& deref(const structtype *obj) { return obj->name; } }
#define REALM_PMTA_USE(structtype,name)             name ## _pmta
#define REALM_PMTA_DEREF(obj,ptrname)               (ptrname::deref(obj))
#else
#define REALM_PMTA_DECL(structtype,membertype,name) membertype structtype::*name
#define REALM_PMTA_DEFN(structtype,membertype,name)
#define REALM_PMTA_USE(structtype,name)             &structtype::name
#define REALM_PMTA_DEREF(obj,ptrname)               ((obj)->*(ptrname))
#endif

namespace Realm {

#ifdef DEBUG_REALM
//define DEBUG_REALM_LISTS
#endif

  template <typename T>
  struct IntrusiveListLink {
    IntrusiveListLink(void);
    ~IntrusiveListLink(void);

    T *next;
#ifdef DEBUG_REALM_LISTS
    // actual type is IntrusiveList<T, LINK, LT>, but that would be a
    //  circular definition...
    void *current_list;
#endif
  };<commit_msg>realm: add dummy typedef to avoid empty declaration for nvc++<commit_after>/* Copyright 2021 Stanford University, NVIDIA Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// templated intrusive linked lists

#ifndef REALM_LISTS_H
#define REALM_LISTS_H

#include "realm/atomics.h"

#ifdef REALM_ON_WINDOWS
#define REALM_PMTA_DECL(structtype,membertype,name) typename name
#define REALM_PMTA_DEFN(structtype,membertype,name) \
  struct name ## _pmta { static membertype& deref(structtype *obj) { return obj->name; } \
                         static const membertype& deref(const structtype *obj) { return obj->name; } }
#define REALM_PMTA_USE(structtype,name)             name ## _pmta
#define REALM_PMTA_DEREF(obj,ptrname)               (ptrname::deref(obj))
#else
#define REALM_PMTA_DECL(structtype,membertype,name) membertype structtype::*name
#ifdef __PGIC__
// PGI warns on empty declarations so add a useless typedef
#define REALM_PMTA_DEFN(structtype,membertype,name) typedef int pgi_appeasement_ ## name
#else
#define REALM_PMTA_DEFN(structtype,membertype,name)
#endif
#define REALM_PMTA_USE(structtype,name)             &structtype::name
#define REALM_PMTA_DEREF(obj,ptrname)               ((obj)->*(ptrname))
#endif

namespace Realm {

#ifdef DEBUG_REALM
//define DEBUG_REALM_LISTS
#endif

  template <typename T>
  struct IntrusiveListLink {
    IntrusiveListLink(void);
    ~IntrusiveListLink(void);

    T *next;
#ifdef DEBUG_REALM_LISTS
    // actual type is IntrusiveList<T, LINK, LT>, but that would be a
    //  circular definition...
    void *current_list;
#endif
  };
{'fraction_non_alphanumeric': 0.09084084084084085, 'fraction_numerical': 0.004004004004004004, 'mean_word_length': 4.164082687338501, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5178263', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1237, 'n_words': 379}