~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to extern/eltopo/eltopo-capi.cpp

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "common/vec.h"
 
2
#include "ccd_wrapper.h"
 
3
#include "cfloat"
 
4
#include "../../source/blender/blenlib/BLI_memarena.h"
 
5
// --------------------------------------------------------------------------------------------------
 
6
// Continuous collision detection
 
7
// --------------------------------------------------------------------------------------------------
 
8
 
 
9
MemArena *arena = NULL;
 
10
 
 
11
/*overload default new operator*/
 
12
void *operator new(size_t size) {
 
13
        if (arena)
 
14
                return BLI_memarena_alloc(arena, size);
 
15
        else
 
16
                return malloc(size);
 
17
}
 
18
 
 
19
void operator delete(void *ptr) {
 
20
        if (!arena)
 
21
                free(ptr);
 
22
}
 
23
 
 
24
extern "C" void eltopo_start_memarena(void)
 
25
{
 
26
        arena = BLI_memarena_new(1<<18, "eltopo arena");        
 
27
}
 
28
 
 
29
extern "C" void eltopo_end_memarena(void)
 
30
{
 
31
        if (arena) {
 
32
                BLI_memarena_free(arena);
 
33
                arena = NULL;
 
34
        }
 
35
}