<commit_before>/* $Id$ */
/*
 * %PSC_START_COPYRIGHT%
 * -----------------------------------------------------------------------------
 * Copyright (c) 2006-2010, Pittsburgh Supercomputing Center (PSC).
 *
 * Permission to use, copy, and modify this software and its documentation
 * without fee for personal use or non-commercial use within your organization
 * is hereby granted, provided that the above copyright notice is preserved in
 * all copies and that the copyright and this permission notice appear in
 * supporting documentation.  Permission to redistribute this software to other
 * organizations or individuals is not permitted without the written permission
 * of the Pittsburgh Supercomputing Center.  PSC makes no representations about
 * the suitability of this software for any purpose.  It is provided "as is"
 * without express or implied warranty.
 * -----------------------------------------------------------------------------
 * %PSC_END_COPYRIGHT%
 */

#ifndef _PFL_MEM_H_
#define _PFL_MEM_H_

#ifdef HAVE_NUMA

#include <bitmask.h>
#include <numa.h>

struct psc_nodemask {
	struct bitmask	*pnm_mask;
};

#define	psc_numa_get_run_node_mask(m)					\
	do {								\
		(m)->pnm_mask = numa_get_run_node_mask();		\
	} while (0)

#define	psc_numa_tonodemask_memory(p, len, m)				\
	numa_tonodemask_memory((p), (len), (m)->pnm_mask)

#else

struct psc_nodemask {
};

#define	psc_numa_get_run_node_mask(m)					\
	do {								\
		/* hack to avoid unused warnings */			\
		(void)(m);						\
	} while (0)

#define	psc_numa_tonodemask_memory(p, len, m)				\
	do {								\
		(void)(p);						\
		(void)(len);						\
		(void)(m);						\
	} while (0)

#endif

#define psc_mprotect(p, len, prot)					\
	do {								\
		if (mprotect((p), (len), (prot)) == -1)			\
			psc_fatal("mprotect %p", (p));			\
	} while (0)

#define psc_munmap(p, len)						\
	do {								\
		if (munmap((p), (len)) == -1)				\
			psc_fatal("munmap %p", (p));			\
	} while (0)

#endif /* _PFL_MEM_H_ */<commit_msg>fix copyright<commit_after>/* $Id$ */
/*
 * %PSC_START_COPYRIGHT%
 * -----------------------------------------------------------------------------
 * Copyright (c) 2009-2010, Pittsburgh Supercomputing Center (PSC).
 *
 * Permission to use, copy, and modify this software and its documentation
 * without fee for personal use or non-commercial use within your organization
 * is hereby granted, provided that the above copyright notice is preserved in
 * all copies and that the copyright and this permission notice appear in
 * supporting documentation.  Permission to redistribute this software to other
 * organizations or individuals is not permitted without the written permission
 * of the Pittsburgh Supercomputing Center.  PSC makes no representations about
 * the suitability of this software for any purpose.  It is provided "as is"
 * without express or implied warranty.
 * -----------------------------------------------------------------------------
 * %PSC_END_COPYRIGHT%
 */

#ifndef _PFL_MEM_H_
#define _PFL_MEM_H_

#ifdef HAVE_NUMA

#include <bitmask.h>
#include <numa.h>

struct psc_nodemask {
	struct bitmask	*pnm_mask;
};

#  define psc_numa_get_run_node_mask(m)					\
	do {								\
		(m)->pnm_mask = numa_get_run_node_mask();		\
	} while (0)

#  define psc_numa_tonodemask_memory(p, len, m)				\
	numa_tonodemask_memory((p), (len), (m)->pnm_mask)

#else

struct psc_nodemask {
};

#  define psc_numa_get_run_node_mask(m)					\
	do {								\
		/* hack to avoid unused warnings */			\
		(void)(m);						\
	} while (0)

#  define psc_numa_tonodemask_memory(p, len, m)				\
	do {								\
		(void)(p);						\
		(void)(len);						\
		(void)(m);						\
	} while (0)

#endif

#define psc_mprotect(p, len, prot)					\
	do {								\
		if (mprotect((p), (len), (prot)) == -1)			\
			psc_fatal("mprotect %p", (p));			\
	} while (0)

#define psc_munmap(p, len)						\
	do {								\
		if (munmap((p), (len)) == -1)				\
			psc_fatal("munmap %p", (p));			\
	} while (0)

#endif /* _PFL_MEM_H_ */
{'fraction_non_alphanumeric': 0.1918081918081918, 'fraction_numerical': 0.007492507492507493, 'mean_word_length': 2.299011532125206, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1772425', 'n_tokens_mistral': 1578, 'n_tokens_neox': 1373, 'n_words': 377}