… | |
… | |
37 | #include <material.h> |
37 | #include <material.h> |
38 | |
38 | |
39 | #include <glib.h> |
39 | #include <glib.h> |
40 | |
40 | |
41 | refcnt_base::refcnt_t refcnt_dummy; |
41 | refcnt_base::refcnt_t refcnt_dummy; |
42 | |
42 | size_t slice_alloc; |
43 | rand_gen rndm; |
43 | rand_gen rndm; |
44 | |
44 | |
45 | void |
45 | void |
46 | tausworthe_random_generator::seed (uint32_t seed) |
46 | tausworthe_random_generator::seed (uint32_t seed) |
47 | { |
47 | { |
… | |
… | |
472 | void *salloc_ (int n) throw (std::bad_alloc) |
472 | void *salloc_ (int n) throw (std::bad_alloc) |
473 | { |
473 | { |
474 | #ifdef PREFER_MALLOC |
474 | #ifdef PREFER_MALLOC |
475 | void *ptr = malloc (n); |
475 | void *ptr = malloc (n); |
476 | #else |
476 | #else |
|
|
477 | slice_alloc += n; |
477 | void *ptr = g_slice_alloc (n); |
478 | void *ptr = g_slice_alloc (n); |
478 | #endif |
479 | #endif |
479 | |
480 | |
480 | if (!ptr) |
481 | if (!ptr) |
481 | throw std::bad_alloc (); |
482 | throw std::bad_alloc (); |