Ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a25176072e02db9254f0e0c84c805cd)
Macros | Functions
defines.h File Reference
#include "ruby/config.h"
#include <stdio.h>
#include "ruby/missing.h"

Go to the source code of this file.

Macros

#define CONSTFUNC(x)   x
 
#define PUREFUNC(x)   x
 
#define DEPRECATED(x)   x
 
#define DEPRECATED_BY(n, x)   DEPRECATED(x)
 
#define DEPRECATED_TYPE(mesg, decl)   decl
 
#define RUBY_CXX_DEPRECATED(mesg)   /* nothing */
 
#define NOINLINE(x)   x
 
#define ALWAYS_INLINE(x)   x
 
#define HAVE_ATTRIBUTE_ERRORFUNC   0
 
#define ERRORFUNC(mesg, x)   x
 
#define HAVE_ATTRIBUTE_WARNINGFUNC   0
 
#define WARNINGFUNC(mesg, x)   x
 
#define GCC_VERSION_SINCE(major, minor, patchlevel)   0
 
#define GCC_VERSION_BEFORE(major, minor, patchlevel)   0
 
#define RB_LIKELY(x)   (x)
 
#define RB_UNLIKELY(x)   (x)
 
#define COLDFUNC
 
#define PRINTF_ARGS(decl, string_index, first_to_check)   decl
 
#define RB_GNUC_EXTENSION
 
#define RB_GNUC_EXTENSION_BLOCK(x)   (x)
 
#define RUBY
 
#define _(args)   ()
 
#define __(args)   ()
 
#define ANYARGS
 
#define xmalloc   ruby_xmalloc
 
#define xmalloc2   ruby_xmalloc2
 
#define xcalloc   ruby_xcalloc
 
#define xrealloc   ruby_xrealloc
 
#define xrealloc2   ruby_xrealloc2
 
#define xfree   ruby_xfree
 
#define RUBY_ATTR_ALLOC_SIZE(params)
 
#define RUBY_ATTR_MALLOC
 
#define RUBY_ATTR_RETURNS_NONNULL
 
#define USE_GC_MALLOC_OBJ_INFO_DETAILS   0
 
#define STRINGIZE(expr)   STRINGIZE0(expr)
 
#define STRINGIZE0(expr)   #expr
 
#define RUBY_FUNC_EXPORTED
 
#define MJIT_FUNC_EXPORTED   RUBY_FUNC_EXPORTED
 
#define MJIT_SYMBOL_EXPORT_BEGIN   RUBY_SYMBOL_EXPORT_BEGIN
 
#define MJIT_SYMBOL_EXPORT_END   RUBY_SYMBOL_EXPORT_END
 
#define EXTERN   <-<-"EXTERN is deprecated, use RUBY_EXTERN instead"->->
 
#define RUBY_MBCHAR_MAXSIZE   INT_MAX
 
#define FLUSH_REGISTER_WINDOWS   ((void)0)
 
#define PATH_SEP   ":"
 
#define PATH_SEP_CHAR   PATH_SEP[0]
 
#define PATH_ENV   "PATH"
 
#define CASEFOLD_FILESYSTEM   0
 
#define DLEXT_MAXLEN   4
 
#define RUBY_PLATFORM   "unknown-unknown"
 
#define FUNC_MINIMIZED(x)   x
 
#define FUNC_UNOPTIMIZED(x)   x
 
#define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args)    FUNC_MINIMIZED(type prot) {return (type)name args;}
 
#define RUBY_ALIAS_FUNCTION_VOID(prot, name, args)    FUNC_MINIMIZED(void prot) {name args;}
 
#define RUBY_ALIAS_FUNCTION(prot, name, args)    RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)
 
#define RUBY_FUNC_NONNULL(n, x)   x
 
#define UNALIGNED_WORD_ACCESS   0
 
#define PACKED_STRUCT(x)   x
 
#define PACKED_STRUCT_UNALIGNED(x)   x
 
#define RUBY_ALIGNAS(x)   /* x */
 
#define RUBY_ALIGNOF(type)   ((size_t)offsetof(struct { char f1; type f2; }, f2))
 
#define NORETURN_STYLE_NEW   1
 
#define NORETURN(x)   x
 

Functions

voidruby_xmalloc (size_t) RUBY_ATTR_MALLOC RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((1))
 
voidruby_xmalloc2 (size_t, size_t) RUBY_ATTR_MALLOC RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((1
 
void voidruby_xcalloc (size_t, size_t) RUBY_ATTR_MALLOC RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((1
 
void void voidruby_xrealloc (void *, size_t) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2))
 
voidruby_xrealloc2 (void *, size_t, size_t) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2
 
void void ruby_xfree (void *)
 

Macro Definition Documentation

◆ _

#define _ (   args)    ()

Definition at line 188 of file defines.h.

◆ __

#define __ (   args)    ()

Definition at line 195 of file defines.h.

◆ ALWAYS_INLINE

#define ALWAYS_INLINE (   x )    x

Definition at line 48 of file defines.h.

◆ ANYARGS

#define ANYARGS

Definition at line 201 of file defines.h.

◆ CASEFOLD_FILESYSTEM

#define CASEFOLD_FILESYSTEM   0

Definition at line 451 of file defines.h.

◆ COLDFUNC

#define COLDFUNC

Definition at line 102 of file defines.h.

◆ CONSTFUNC

#define CONSTFUNC (   x )    x

Definition at line 27 of file defines.h.

◆ DEPRECATED

#define DEPRECATED (   x )    x

Definition at line 33 of file defines.h.

◆ DEPRECATED_BY

#define DEPRECATED_BY (   n,
 
)    DEPRECATED(x)

Definition at line 36 of file defines.h.

◆ DEPRECATED_TYPE

#define DEPRECATED_TYPE (   mesg,
  decl 
)    decl

Definition at line 39 of file defines.h.

◆ DLEXT_MAXLEN

#define DLEXT_MAXLEN   4

Definition at line 456 of file defines.h.

◆ ERRORFUNC

#define ERRORFUNC (   mesg,
 
)    x

Definition at line 52 of file defines.h.

◆ EXTERN

#define EXTERN   <-<-"EXTERN is deprecated, use RUBY_EXTERN instead"->->

Definition at line 418 of file defines.h.

◆ FLUSH_REGISTER_WINDOWS

#define FLUSH_REGISTER_WINDOWS   ((void)0)

Definition at line 431 of file defines.h.

◆ FUNC_MINIMIZED

#define FUNC_MINIMIZED (   x )    x

Definition at line 464 of file defines.h.

◆ FUNC_UNOPTIMIZED

#define FUNC_UNOPTIMIZED (   x )    x

Definition at line 467 of file defines.h.

◆ GCC_VERSION_BEFORE

#define GCC_VERSION_BEFORE (   major,
  minor,
  patchlevel 
)    0

Definition at line 82 of file defines.h.

◆ GCC_VERSION_SINCE

#define GCC_VERSION_SINCE (   major,
  minor,
  patchlevel 
)    0

Definition at line 71 of file defines.h.

◆ HAVE_ATTRIBUTE_ERRORFUNC

#define HAVE_ATTRIBUTE_ERRORFUNC   0

Definition at line 51 of file defines.h.

◆ HAVE_ATTRIBUTE_WARNINGFUNC

#define HAVE_ATTRIBUTE_WARNINGFUNC   0

Definition at line 57 of file defines.h.

◆ MJIT_FUNC_EXPORTED

#define MJIT_FUNC_EXPORTED   RUBY_FUNC_EXPORTED

Definition at line 396 of file defines.h.

◆ MJIT_SYMBOL_EXPORT_BEGIN

#define MJIT_SYMBOL_EXPORT_BEGIN   RUBY_SYMBOL_EXPORT_BEGIN

Definition at line 397 of file defines.h.

◆ MJIT_SYMBOL_EXPORT_END

#define MJIT_SYMBOL_EXPORT_END   RUBY_SYMBOL_EXPORT_END

Definition at line 398 of file defines.h.

◆ NOINLINE

#define NOINLINE (   x )    x

Definition at line 45 of file defines.h.

◆ NORETURN

#define NORETURN (   x )    x

Definition at line 529 of file defines.h.

◆ NORETURN_STYLE_NEW

#define NORETURN_STYLE_NEW   1

Definition at line 521 of file defines.h.

◆ PACKED_STRUCT

#define PACKED_STRUCT (   x)    x

Definition at line 497 of file defines.h.

◆ PACKED_STRUCT_UNALIGNED

#define PACKED_STRUCT_UNALIGNED (   x)    x

Definition at line 503 of file defines.h.

◆ PATH_ENV

#define PATH_ENV   "PATH"

Definition at line 441 of file defines.h.

◆ PATH_SEP

#define PATH_SEP   ":"

Definition at line 437 of file defines.h.

◆ PATH_SEP_CHAR

#define PATH_SEP_CHAR   PATH_SEP[0]

Definition at line 439 of file defines.h.

◆ PRINTF_ARGS

#define PRINTF_ARGS (   decl ,
  string_index,
  first_to_check 
)    decl

Definition at line 114 of file defines.h.

◆ PUREFUNC

#define PUREFUNC (   x )    x

Definition at line 30 of file defines.h.

◆ RB_GNUC_EXTENSION

#define RB_GNUC_EXTENSION

Definition at line 121 of file defines.h.

◆ RB_GNUC_EXTENSION_BLOCK

#define RB_GNUC_EXTENSION_BLOCK (   x)    (x)

Definition at line 122 of file defines.h.

◆ RB_LIKELY

#define RB_LIKELY (   x)    (x)

Definition at line 91 of file defines.h.

◆ RB_UNLIKELY

#define RB_UNLIKELY (   x)    (x)

Definition at line 92 of file defines.h.

◆ RUBY

#define RUBY

Definition at line 173 of file defines.h.

◆ RUBY_ALIAS_FUNCTION

#define RUBY_ALIAS_FUNCTION (   prot,
  name,
  args 
)     RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)

Definition at line 478 of file defines.h.

◆ RUBY_ALIAS_FUNCTION_TYPE

#define RUBY_ALIAS_FUNCTION_TYPE (   type,
  prot,
  name,
  args 
)     FUNC_MINIMIZED(type prot) {return (type)name args;}

Definition at line 470 of file defines.h.

◆ RUBY_ALIAS_FUNCTION_VOID

#define RUBY_ALIAS_FUNCTION_VOID (   prot,
  name,
  args 
)     FUNC_MINIMIZED(void prot) {name args;}

Definition at line 474 of file defines.h.

◆ RUBY_ALIGNAS

#define RUBY_ALIGNAS (   x)    /* x */

Definition at line 508 of file defines.h.

◆ RUBY_ALIGNOF

#define RUBY_ALIGNOF (   type)    ((size_t)offsetof(struct { char f1; type f2; }, f2))

Definition at line 518 of file defines.h.

◆ RUBY_ATTR_ALLOC_SIZE

#define RUBY_ATTR_ALLOC_SIZE (   params)

Definition at line 226 of file defines.h.

◆ RUBY_ATTR_MALLOC

#define RUBY_ATTR_MALLOC

Definition at line 235 of file defines.h.

◆ RUBY_ATTR_RETURNS_NONNULL

#define RUBY_ATTR_RETURNS_NONNULL

Definition at line 244 of file defines.h.

◆ RUBY_CXX_DEPRECATED

#define RUBY_CXX_DEPRECATED (   mesg)    /* nothing */

Definition at line 42 of file defines.h.

◆ RUBY_FUNC_EXPORTED

#define RUBY_FUNC_EXPORTED

Definition at line 391 of file defines.h.

◆ RUBY_FUNC_NONNULL

#define RUBY_FUNC_NONNULL (   n,
 
)    x

Definition at line 482 of file defines.h.

◆ RUBY_MBCHAR_MAXSIZE

#define RUBY_MBCHAR_MAXSIZE   INT_MAX

Definition at line 423 of file defines.h.

◆ RUBY_PLATFORM

#define RUBY_PLATFORM   "unknown-unknown"

Definition at line 460 of file defines.h.

◆ STRINGIZE

#define STRINGIZE (   expr)    STRINGIZE0(expr)

Definition at line 331 of file defines.h.

◆ STRINGIZE0

#define STRINGIZE0 (   expr)    #expr

Definition at line 333 of file defines.h.

◆ UNALIGNED_WORD_ACCESS

#define UNALIGNED_WORD_ACCESS   0

Definition at line 493 of file defines.h.

◆ USE_GC_MALLOC_OBJ_INFO_DETAILS

#define USE_GC_MALLOC_OBJ_INFO_DETAILS   0

Definition at line 255 of file defines.h.

◆ WARNINGFUNC

#define WARNINGFUNC (   mesg,
 
)    x

Definition at line 58 of file defines.h.

◆ xcalloc

#define xcalloc   ruby_xcalloc

Definition at line 213 of file defines.h.

◆ xfree

#define xfree   ruby_xfree

Definition at line 216 of file defines.h.

◆ xmalloc

#define xmalloc   ruby_xmalloc

Definition at line 211 of file defines.h.

◆ xmalloc2

#define xmalloc2   ruby_xmalloc2

Definition at line 212 of file defines.h.

◆ xrealloc

#define xrealloc   ruby_xrealloc

Definition at line 214 of file defines.h.

◆ xrealloc2

#define xrealloc2   ruby_xrealloc2

Definition at line 215 of file defines.h.

Function Documentation

◆ ruby_xcalloc()

void void * ruby_xcalloc ( size_t  ,
size_t   
)

◆ ruby_xfree()

void void ruby_xfree ( void x)

Definition at line 10183 of file gc.c.

Referenced by rb_free_tmp_buffer().

◆ ruby_xmalloc()

void * ruby_xmalloc ( size_t  size)

Definition at line 12008 of file gc.c.

◆ ruby_xmalloc2()

void * ruby_xmalloc2 ( size_t  ,
size_t   
)

◆ ruby_xrealloc()

void void void * ruby_xrealloc ( void ptr,
size_t  new_size 
)

Definition at line 12038 of file gc.c.

◆ ruby_xrealloc2()

void * ruby_xrealloc2 ( void ,
size_t  ,
size_t   
)