[vmkit-commits] [vmkit] r108826 - /vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Tue Jul 20 05:20:53 PDT 2010


Author: geoffray
Date: Tue Jul 20 07:20:53 2010
New Revision: 108826

URL: http://llvm.org/viewvc/llvm-project?rev=108826&view=rev
Log:
Remove use of alloca.


Modified:
    vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp

Modified: vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp?rev=108826&r1=108825&r2=108826&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp (original)
+++ vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp Tue Jul 20 07:20:53 2010
@@ -1,3 +1,4 @@
+#include "mvm/Allocator.h"
 #include "mvm/UTF8.h"
 #include "mvm/PrintBuffer.h"
 
@@ -10,7 +11,8 @@
 
 const UTF8* UTF8::extract(UTF8Map* map, uint32 start, uint32 end) const {
   uint32 len = end - start;
-  uint16* buf = (uint16*)alloca(sizeof(uint16) * len);
+  ThreadAllocator allocator;
+  uint16* buf = (uint16*)allocator.Allocate(sizeof(uint16) * len);
 
   for (uint32 i = 0; i < len; i++) {
     buf[i] = elements[i + start];





More information about the vmkit-commits mailing list