"Fossies" - the Fresh Open Source Software Archive

Member "lttng-modules-2.11.0-rc5/wrapper/vzalloc.h" (11 Jun 2019, 593 Bytes) of package /linux/misc/lttng-modules-2.11.0-rc5.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "vzalloc.h" see the Fossies "Dox" file reference documentation.

    1 /* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
    2  *
    3  * wrapper/vzalloc.h
    4  *
    5  * Copyright (C) 2015 Michael Jeanson <mjeanson@efficios.com>
    6  */
    7 
    8 #ifndef _LTTNG_WRAPPER_VZALLOC_H
    9 #define _LTTNG_WRAPPER_VZALLOC_H
   10 
   11 #include <linux/version.h>
   12 #include <linux/vmalloc.h>
   13 
   14 #if LTTNG_KERNEL_RANGE(2,6,36, 2,6,37)
   15 static inline
   16 void *lttng_vzalloc(unsigned long size)
   17 {
   18     void *ret;
   19     ret = vmalloc(size);
   20     if (!ret)
   21         return NULL;
   22     memset(ret, 0, size);
   23     return ret;
   24 }
   25 #else
   26 static inline
   27 void *lttng_vzalloc(unsigned long size)
   28 {
   29     return vzalloc(size);
   30 }
   31 #endif
   32 
   33 
   34 #endif /* _LTTNG_WRAPPER_VZALLOC_H */