[llvm-commits] CVS: llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi/newvor.c
Vikram Adve
vadve at cs.uiuc.edu
Tue May 25 03:35:03 PDT 2004
Changes in directory llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi:
newvor.c updated: 1.3 -> 1.4
---
Log message:
Fixed myalign() to use memalign() instead of doing it manually, which
causes most heap nodes to be collapsed.
---
Diffs of the changes: (+10 -0)
Index: llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi/newvor.c
diff -u llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi/newvor.c:1.3 llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi/newvor.c:1.4
--- llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi/newvor.c:1.3 Sun Oct 19 18:54:09 2003
+++ llvm/test/Programs/MultiSource/Benchmarks/Olden/voronoi/newvor.c Tue May 25 03:31:18 2004
@@ -163,14 +163,24 @@
/* memalign() on my SGI doesn't work. Thus, I have to write my own */
void* myalign(int align_size, int alloc_size)
{
+#ifdef MEMALIGN_IS_NOT_AVAILABLE
char* base = (char*)malloc(alloc_size + align_size);
+#else
+ char* base = (char*)memalign(align_size, alloc_size);
+#endif
void *Result;
if (base == NULL){
printf("myalign() failed\n");
exit(-1);
}
+#ifdef MEMALIGN_IS_NOT_AVAILABLE
return (void*)(base + align_size - ((uptrint)base % align_size));
+#else
+ return base;
+#endif
}
+
+
QUAD_EDGE alloc_edge() {
QUAD_EDGE ans;
More information about the llvm-commits
mailing list