Text archives Help
- From: "Solomon Boulos" <boulos@cs.utah.edu>
- To: manta@sci.utah.edu
- Subject: [Manta] r2066 - in trunk: Engine/Control Model/Groups
- Date: Wed, 13 Feb 2008 19:13:21 -0700 (MST)
Author: boulos
Date: Wed Feb 13 19:13:19 2008
New Revision: 2066
Modified:
trunk/Engine/Control/RTRT.cc
trunk/Model/Groups/DynBVH.cc
trunk/Model/Groups/DynBVH.h
Log:
Engine/Control/RTRT.cc
Leaving myself a warning when testing the UpdateGraph.
Model/Groups/DynBVH.cc
Model/Groups/DynBVH.h
Adding code to free the memory used by parallelBuild when starting
the parallelUpdate. Can anyone explain why C++ doesn't guarantee that
delete sets the pointer to NULL? I can't seem to think of why you'd
want to hold on to a pointer to memory you just freed up.
Modified: trunk/Engine/Control/RTRT.cc
==============================================================================
--- trunk/Engine/Control/RTRT.cc (original)
+++ trunk/Engine/Control/RTRT.cc Wed Feb 13 19:13:19 2008
@@ -681,6 +681,7 @@
// ensure everything is thread-safe throughout the tree.
if (proc == 0) {
doPreprocess(proc, 1);
+ //#warning "Adding objects to the update graph"
//scene->getObject()->addToUpdateGraph(update_graph, NULL);
//update_graph->print(scene->getObject());
}
Modified: trunk/Model/Groups/DynBVH.cc
==============================================================================
--- trunk/Model/Groups/DynBVH.cc (original)
+++ trunk/Model/Groups/DynBVH.cc Wed Feb 13 19:13:19 2008
@@ -626,6 +626,19 @@
// preallocate task list memory
int num_possible = num_nodes + 1;
cerr << "Updating " << num_possible << " nodes\n";
+ if (TaskListMemory) {
+ delete[] TaskListMemory;
+ TaskListMemory = 0;
+ }
+ if (TaskMemory) {
+ delete[] TaskMemory;
+ TaskMemory = 0;
+ }
+ if (TwoArgCallbackMemory) {
+ delete[] TwoArgCallbackMemory;
+ TwoArgCallbackMemory = 0;
+ }
+
TaskListMemory = new char[(num_possible) * sizeof(TaskList)];
CurTaskList = 0;
TaskMemory = new char[2 * (num_possible) * sizeof(Task)];
@@ -673,20 +686,30 @@
CurFourArgCallback = 0;
CurFiveArgCallback = 0;
- if (TaskListMemory)
+ if (TaskListMemory) {
delete[] TaskListMemory;
+ TaskListMemory = 0;
+ }
- if (TaskMemory)
+ if (TaskMemory) {
delete[] TaskMemory;
+ TaskMemory = 0;
+ }
- if (TwoArgCallbackMemory)
+ if (TwoArgCallbackMemory) {
delete[] TwoArgCallbackMemory;
+ TwoArgCallbackMemory = 0;
+ }
- if (FourArgCallbackMemory)
+ if (FourArgCallbackMemory) {
delete[] FourArgCallbackMemory;
+ FourArgCallbackMemory = 0;
+ }
- if (FiveArgCallbackMemory)
+ if (FiveArgCallbackMemory) {
delete[] FiveArgCallbackMemory;
+ FiveArgCallbackMemory = 0;
+ }
context.finish(this);
}
Modified: trunk/Model/Groups/DynBVH.h
==============================================================================
--- trunk/Model/Groups/DynBVH.h (original)
+++ trunk/Model/Groups/DynBVH.h Wed Feb 13 19:13:19 2008
@@ -94,7 +94,6 @@
size_t CurFiveArgCallback;
bool print_info;
-
public:
DynBVH(bool print = true) : num_nodes("DynBVH Num Nodes", 0),
currGroup(NULL), group_changed(false), barrier("DynBVH barrier"),
nextFree("DynBVH Next Free", 0), TaskListMemory(0), CurTaskList(0),
TaskMemory(0), CurTask(0), TwoArgCallbackMemory(0), CurTwoArgCallback(0),
FourArgCallbackMemory(0), CurFourArgCallback(0), FiveArgCallbackMemory(0),
CurFiveArgCallback(0), print_info(print)
- [Manta] r2066 - in trunk: Engine/Control Model/Groups, Solomon Boulos, 02/13/2008
Archive powered by MHonArc 2.6.16.