Blender V5.0
creator.cc File Reference
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "CLG_log.h"
#include "DNA_genfile.h"
#include "BLI_endian_defines.h"
#include "BLI_fftw.hh"
#include "BLI_path_utils.hh"
#include "BLI_string.h"
#include "BLI_system.h"
#include "BLI_task.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "BKE_appdir.hh"
#include "BKE_blender.hh"
#include "BKE_brush.hh"
#include "BKE_callbacks.hh"
#include "BKE_context.hh"
#include "BKE_cpp_types.hh"
#include "BKE_global.hh"
#include "BKE_idtype.hh"
#include "BKE_material.hh"
#include "BKE_modifier.hh"
#include "BKE_node.hh"
#include "BKE_particle.h"
#include "BKE_shader_fx.h"
#include "BKE_sound.h"
#include "BKE_vfont.hh"
#include "BKE_volume.hh"
#include "BLI_args.h"
#include "DEG_depsgraph.hh"
#include "IMB_imbuf.hh"
#include "MOV_util.hh"
#include "RE_engine.h"
#include "RE_texture.h"
#include "ED_datafiles.h"
#include "SEQ_modifier.hh"
#include "WM_api.hh"
#include "RNA_define.hh"
#include <csignal>
#include "creator_intern.h"
#include "gmp.h"
#include "tbb/scalable_allocator.h"

Go to the source code of this file.

Classes

struct  CreatorAtExitData_EarlyExit
struct  CreatorAtExitData

Functions

Application Level Callbacks

Initialize callbacks for the modules that need them.

static void callback_mem_error (const char *errorStr)
static void main_callback_setup ()
static void callback_main_atexit (void *user_data)
static void callback_clg_fatal (void *fp)
GMP Allocator Workaround
void * gmp_alloc (size_t size)
void * gmp_realloc (void *ptr, size_t, size_t new_size)
void gmp_free (void *ptr, size_t)
void gmp_blender_init_allocator ()
static void restore_ld_preload ()
Main Function
int main (int argc, const char **argv)

Variables

Local Application State
ApplicationState app_state

Function Documentation

◆ callback_clg_fatal()

void callback_clg_fatal ( void * fp)
static

Definition at line 213 of file creator.cc.

References BLI_system_backtrace().

Referenced by main().

◆ callback_main_atexit()

void callback_main_atexit ( void * user_data)
static

◆ callback_mem_error()

void callback_mem_error ( const char * errorStr)
static

Definition at line 143 of file creator.cc.

Referenced by main_callback_setup().

◆ gmp_alloc()

void * gmp_alloc ( size_t size)

Definition at line 256 of file creator.cc.

References size().

Referenced by gmp_blender_init_allocator().

◆ gmp_blender_init_allocator()

void gmp_blender_init_allocator ( )

Use TBB's scalable_allocator on Windows. TBBmalloc correctly captures all allocations already, however, GMP is built with MINGW since it doesn't build with MSVC, which TBB has issues hooking into automatically.

Definition at line 275 of file creator.cc.

References gmp_alloc(), gmp_free(), and gmp_realloc().

Referenced by main().

◆ gmp_free()

void gmp_free ( void * ptr,
size_t  )

Definition at line 265 of file creator.cc.

References ptr.

Referenced by gmp_blender_init_allocator().

◆ gmp_realloc()

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

Definition at line 260 of file creator.cc.

References ptr.

Referenced by gmp_blender_init_allocator().

◆ main()

int main ( int argc,
const char ** argv )

Blender's main function responsibilities are:

  • setup subsystems.
  • handle arguments.
  • run WM_main() event loop, or exit immediately when running in background-mode.

Definition at line 308 of file creator.cc.

References alloc_utf_8_from_16(), app_state, ARG_PASS_ENVIRONMENT, ARG_PASS_FINAL, ARG_PASS_SETTINGS, ARG_PASS_SETTINGS_FORCE, ARG_PASS_SETTINGS_GUI, CreatorAtExitData::ba, BKE_appdir_init(), BKE_appdir_program_path_init(), BKE_blender_atexit_register(), BKE_blender_atexit_unregister(), BKE_blender_globals_init(), BKE_brush_system_init(), BKE_callback_global_init(), BKE_cpp_types_init(), BKE_idtype_init(), BKE_materials_init(), BKE_modifier_init(), BKE_particle_init_rng(), BKE_shaderfx_init(), BKE_sound_force_device(), BKE_sound_init_once(), BKE_vfont_builtin_register(), BKE_volumes_init(), BLI_args_create(), BLI_args_parse(), BLI_assert, BLI_assert_unreachable, BLI_task_scheduler_init(), BLI_threadapi_init(), build_commit_date, build_commit_time, build_commit_timestamp, C, CreatorAtExitData_EarlyExit::C, callback_clg_fatal(), callback_main_atexit(), CCL_log_init(), CLG_fatal_fn_set(), CLG_init(), CLG_output_use_basename_set(), CLG_output_use_memory_set(), CLG_output_use_source_set(), CLG_output_use_timestamp_set(), CTX_create(), datatoc_bfont_pfb, datatoc_bfont_pfb_size, DEG_register_node_types(), DNA_sdna_current_init(), CreatorAtExitData::early_exit, FRS_init(), FRS_set_context(), G, GHOST_HACK_getFirstFile(), gmp_blender_init_allocator(), i, IMB_init(), blender::fftw::initialize_float(), libmv_initLogging(), LIKELY, main_arg_deferred_free(), main_arg_deferred_handle(), main_args_handle_load_file(), main_args_setup(), main_callback_setup(), main_signal_setup(), main_signal_setup_background(), MEM_init_memleak_detection(), MEM_use_guarded_allocator(), blender::seq::modifiers_init(), MOV_init(), blender::bke::node_system_init(), printf, RE_engines_init(), RE_texture_rng_init(), restore_ld_preload(), RNA_init(), STR_ELEM, STREQ, STRNCPY(), STRPREFIX, WM_exit(), WM_init(), WM_init_splash_on_startup(), and WM_main().

◆ main_callback_setup()

void main_callback_setup ( )
static

Definition at line 149 of file creator.cc.

References callback_mem_error(), and MEM_set_error_callback.

Referenced by main().

◆ restore_ld_preload()

void restore_ld_preload ( )
static

Definition at line 281 of file creator.cc.

References BLI_getenv(), BLI_setenv(), and restore_ld_preload().

Referenced by main(), and restore_ld_preload().

Variable Documentation

◆ app_state