~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to extern/bullet2/src/LinearMath/btAlignedAllocator.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:
160
160
void*   btAlignedAllocInternal  (size_t size, int alignment)
161
161
{
162
162
        gNumAlignedAllocs++;
163
 
  void* ptr;
164
 
#if defined (BT_HAS_ALIGNED_ALLOCATOR) || defined(__CELLOS_LV2__)
 
163
        void* ptr;
165
164
        ptr = sAlignedAllocFunc(size, alignment);
166
 
#else
167
 
  char *real;
168
 
  unsigned long offset;
169
 
 
170
 
  real = (char *)sAllocFunc(size + sizeof(void *) + (alignment-1));
171
 
  if (real) {
172
 
    offset = (alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1);
173
 
    ptr = (void *)((real + sizeof(void *)) + offset);
174
 
    *((void **)(ptr)-1) = (void *)(real);
175
 
  } else {
176
 
    ptr = (void *)(real);
177
 
  }
178
 
#endif  // defined (BT_HAS_ALIGNED_ALLOCATOR) || defined(__CELLOS_LV2__)
179
165
//      printf("btAlignedAllocInternal %d, %x\n",size,ptr);
180
166
        return ptr;
181
167
}
189
175
 
190
176
        gNumAlignedFree++;
191
177
//      printf("btAlignedFreeInternal %x\n",ptr);
192
 
#if defined (BT_HAS_ALIGNED_ALLOCATOR) || defined(__CELLOS_LV2__)
193
178
        sAlignedFreeFunc(ptr);
194
 
#else
195
 
  void* real;
196
 
 
197
 
  if (ptr) {
198
 
    real = *((void **)(ptr)-1);
199
 
    sFreeFunc(real);
200
 
  }
201
 
#endif  // defined (BT_HAS_ALIGNED_ALLOCATOR) || defined(__CELLOS_LV2__)
202
179
}
203
180
 
204
181
#endif //BT_DEBUG_MEMORY_ALLOCATIONS