memory problem?

From: Chiara Zampolli <>
Date: Thu, 23 Nov 2006 17:09:04 +0100

Dear rooters,

     sorry to bother you with my large number of mails....

     I have been able to solve the problem of my previous mail using malloc, but now I have some more doubts... Since I have to write a very big array (the one causing me troubles) in a tree (16000 entries, with an array of 1500 elements each, corresponding to a 2D array of 16000x1500 elements), but using the executable generated compiling the main chiara.cxx you find attached, I have used malloc (solution of my previos problem). In this way, I am able to fill the tree in the correct way, but i still don't understand why lines 33 and 37 in the main don't work (so, instead, I use lines 34 and 38). And, moreover, I don't know whether the way I am now following is the smartest one or not (especially in terms of CPU, memory...).

      Do you have any suggestions?
      Thank you again.
      Best Regards,



TARGET		:= chiara
SOURCES		:= chiara.cxx

#BINS := chiara

# you shouldn't need to change anything below this line.
OBJECTS		:= $(TARGET).o $(filter-out $(TARGET).o, 	\
				$(filter %.o, $(SOURCES:%.cxx=%.o))	\
				$(filter %.o, $(SOURCES:%.c=%.o)))

# Third party libraries
ROOT_CFLAGS	:= $(filter-out -I% -D%, $(shell root-config --cflags))
ROOT_CPPFLAGS	:= $(filter-out $(ROOT_CFLAGS), $(shell root-config --cflags))
ROOT_LDFLAGS	:= $(filter-out -l%, $(shell root-config --libs))
ROOT_LIBS	:= $(filter -l%, $(shell root-config --libs)) -lNew -lVMC -lGeom -lEG -lMinuit

# Compilers and such
CPP		:= g++ -E
CC		:= gcc -c 
CXX		:= g++ -c 
LD		:= g++ 

# Pattern rules


        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $<


        $(CC) $(CPPFLAGS) $(CFLAGS) $<

        $(LD) $^ $(LDFLAGS) $(LIBS) -o $@

# Targets

all: $(TARGET)


        rm -rf $(TARGET) $(OBJECTS)


	@echo "TARGET           : $(TARGET)"
	@echo "SOURCES          : $(SOURCES)"
	@echo "OBJECTS          : $(OBJECTS)"
	@echo "-----------------"
	@echo "ROOT_CFLAGS      : $(ROOT_CFLAGS)"
	@echo "ROOT_LIBS        : $(ROOT_LIBS)"
	@echo "-----------------"
	@echo "CPP              : $(CPP)"
	@echo 'CPPFLAGS         : $(CPPFLAGS)'
	@echo "CXX              : $(CXX)"
	@echo 'CXXFLAGS         : $(CXXFLAGS)'
	@echo "LD               : $(LD)"
	@echo "LDFLAGS          : $(LDFLAGS)"
	@echo "LIBS             : $(LIBS)"


Received on Thu Nov 23 2006 - 17:00:16 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:02 MET