Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 336 vs 337 for /trunk/Source Code/Libs/src/ReCast/ReCast/Source/RecastAlloc.cpp

Diff revisions: vs.
  @@ -22,12 +22,12 @@
22 22
23 23 static void *rcAllocDefault(int size, rcAllocHint)
24 24 {
25 - return malloc(size);
25 + return malloc(size);
26 26 }
27 27
28 28 static void rcFreeDefault(void *ptr)
29 29 {
30 - free(ptr);
30 + free(ptr);
31 31 }
32 32
33 33 static rcAllocFunc* sRecastAllocFunc = rcAllocDefault;
  @@ -36,14 +36,14 @@
36 36 /// @see rcAlloc, rcFree
37 37 void rcAllocSetCustom(rcAllocFunc *allocFunc, rcFreeFunc *freeFunc)
38 38 {
39 - sRecastAllocFunc = allocFunc ? allocFunc : rcAllocDefault;
40 - sRecastFreeFunc = freeFunc ? freeFunc : rcFreeDefault;
39 + sRecastAllocFunc = allocFunc ? allocFunc : rcAllocDefault;
40 + sRecastFreeFunc = freeFunc ? freeFunc : rcFreeDefault;
41 41 }
42 42
43 43 /// @see rcAllocSetCustom
44 44 void* rcAlloc(int size, rcAllocHint hint)
45 45 {
46 - return sRecastAllocFunc(size, hint);
46 + return sRecastAllocFunc(size, hint);
47 47 }
48 48
49 49 /// @par
  @@ -54,8 +54,8 @@
54 54 /// @see rcAllocSetCustom
55 55 void rcFree(void* ptr)
56 56 {
57 - if (ptr)
58 - sRecastFreeFunc(ptr);
57 + if (ptr)
58 + sRecastFreeFunc(ptr);
59 59 }
60 60
61 61 /// @class rcIntArray
  @@ -74,15 +74,15 @@
74 74 /// avoiding auto-resizing during use.
75 75 void rcIntArray::resize(int n)
76 76 {
77 - if (n > m_cap)
78 - {
79 - if (!m_cap) m_cap = n;
80 - while (m_cap < n) m_cap *= 2;
81 - int* newData = (int*)rcAlloc(m_cap*sizeof(int), RC_ALLOC_TEMP);
82 - if (m_size && newData) memcpy(newData, m_data, m_size*sizeof(int));
83 - rcFree(m_data);
84 - m_data = newData;
85 - }
86 - m_size = n;
77 + if (n > m_cap)
78 + {
79 + if (!m_cap) m_cap = n;
80 + while (m_cap < n) m_cap *= 2;
81 + int* newData = (int*)rcAlloc(m_cap*sizeof(int), RC_ALLOC_TEMP);
82 + if (m_size && newData) memcpy(newData, m_data, m_size*sizeof(int));
83 + rcFree(m_data);
84 + m_data = newData;
85 + }
86 + m_size = n;
87 87 }
88 88