X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Fref-internal.h;h=a02ae4cdc1229a627226e74991cebb49887b4820;hb=a0377dfefe40662ba7d68617bce6ff467114136c;hp=4ecb2e25ae8aba93c02d3ec59e34d76682ed69ac;hpb=8abe313a6c4f251063e4b72ddd47ce8107384d71;p=lttng-tools.git diff --git a/include/lttng/ref-internal.h b/include/lttng/ref-internal.h index 4ecb2e25a..a02ae4cdc 100644 --- a/include/lttng/ref-internal.h +++ b/include/lttng/ref-internal.h @@ -6,23 +6,10 @@ * * Copyright 2013, 2014 Jérémie Galarneau * - * Author: Jérémie Galarneau + * SPDX-License-Identifier: LGPL-2.1-only * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License, version 2.1 only, - * as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include typedef void (*lttng_release_func)(void *); @@ -34,7 +21,7 @@ struct lttng_ref { static inline void lttng_ref_init(struct lttng_ref *ref, lttng_release_func release) { - assert(ref); + LTTNG_ASSERT(ref); ref->count = 1; ref->release = release; } @@ -42,18 +29,18 @@ void lttng_ref_init(struct lttng_ref *ref, lttng_release_func release) static inline void lttng_ref_get(struct lttng_ref *ref) { - assert(ref); + LTTNG_ASSERT(ref); ref->count++; /* Overflow check. */ - assert(ref->count); + LTTNG_ASSERT(ref->count); } static inline void lttng_ref_put(struct lttng_ref *ref) { - assert(ref); + LTTNG_ASSERT(ref); /* Underflow check. */ - assert(ref->count); + LTTNG_ASSERT(ref->count); if (caa_unlikely((--ref->count) == 0)) { ref->release(ref); }