# HG changeset patch # User Me@portablequad # Date 1329166662 28800 # Node ID cd8275f62ee1b4f95a4b1172e45bb673724f410d # Parent 24800f145c329f5040628f3ec5b4f279154adf7e added pure C brch diff -r 24800f145c32 -r cd8275f62ee1 DblHist.c --- a/DblHist.c Mon Feb 13 12:50:42 2012 -0800 +++ b/DblHist.c Mon Feb 13 12:57:42 2012 -0800 @@ -28,8 +28,8 @@ DblHist *hist; int i; - hist = VMS_int__malloc( sizeof(DblHist) ); - hist->bins = VMS_int__malloc( numBins * sizeof(int) ); + hist = malloc( sizeof(DblHist) ); + hist->bins = malloc( numBins * sizeof(int) ); hist->numBins = numBins; hist->binWidth = binWidth; @@ -102,6 +102,6 @@ void freeDblHist( DblHist *hist ) { - VMS_int__free( hist->bins ); - VMS_int__free( hist ); + free( hist->bins ); + free( hist ); } diff -r 24800f145c32 -r cd8275f62ee1 FloatHist.c --- a/FloatHist.c Mon Feb 13 12:50:42 2012 -0800 +++ b/FloatHist.c Mon Feb 13 12:57:42 2012 -0800 @@ -26,8 +26,8 @@ FloatHist *hist; int i; - hist = VMS_int__malloc( sizeof(FloatHist) ); - hist->bins = VMS_int__malloc( numBins * sizeof(int) ); + hist = malloc( sizeof(FloatHist) ); + hist->bins = malloc( numBins * sizeof(int) ); hist->numBins = numBins; hist->binWidth = binWidth; @@ -100,6 +100,6 @@ void freeFloatHist( FloatHist *hist ) { - VMS_int__free( hist->bins ); - VMS_int__free( hist ); + free( hist->bins ); + free( hist ); } diff -r 24800f145c32 -r cd8275f62ee1 Histogram.c --- a/Histogram.c Mon Feb 13 12:50:42 2012 -0800 +++ b/Histogram.c Mon Feb 13 12:57:42 2012 -0800 @@ -34,8 +34,8 @@ int32 i; - hist = VMS_int__malloc( sizeof(Histogram) ); - hist->bins = VMS_int__malloc( numBins * sizeof(int32) ); + hist = malloc( sizeof(Histogram) ); + hist->bins = malloc( numBins * sizeof(int32) ); hist->numBins = numBins; hist->binWidth = (endOfRange - startOfRange) / numBins; @@ -71,10 +71,10 @@ { Histogram *hist; - hist = VMS_int__malloc( sizeof(Histogram) ); - hist->bins = VMS_int__malloc( numBins * sizeof(int32) ); + hist = malloc( sizeof(Histogram) ); + hist->bins = malloc( numBins * sizeof(int32) ); - makeHist_helper( hist, numBins, startOfRange, binWidth,VMS_int__strDup(name)); + makeHist_helper( hist, numBins, startOfRange, binWidth,strDup(name)); return hist; } @@ -345,9 +345,9 @@ void freeHist( Histogram *hist ) { - VMS_int__free( hist->bins ); - VMS_int__free( hist->name ); - VMS_int__free( hist ); + free( hist->bins ); + free( hist->name ); + free( hist ); } void freeHistExt( Histogram *hist ) diff -r 24800f145c32 -r cd8275f62ee1 Histogram.h --- a/Histogram.h Mon Feb 13 12:50:42 2012 -0800 +++ b/Histogram.h Mon Feb 13 12:57:42 2012 -0800 @@ -6,10 +6,6 @@ * */ -#include "../../VMS_Implementations/VMS_impl/VMS.h" -#include "../../VMS_Implementations/VMS_impl/vmalloc.h" -#include "../../VMS_Implementations/VMS_impl/vutilities.h" - #ifndef _HISTOGRAM_H #define _HISTOGRAM_H diff -r 24800f145c32 -r cd8275f62ee1 __brch__MC_shared --- a/__brch__MC_shared Mon Feb 13 12:50:42 2012 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -This branch is for the project structure defined Jan 2012.. the #includes reflect this directory structure. - -More importantly, the MC_shared version of VMS requires a separat malloc implemeted by VMS code.. so this branch has modified the library to use the VMS-specific malloc. - diff -r 24800f145c32 -r cd8275f62ee1 __brch__pure_C --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/__brch__pure_C Mon Feb 13 12:57:42 2012 -0800 @@ -0,0 +1,6 @@ + +This branch is for use in pure C code (*not* inside VMS-based language application code) + +There are two versions of the library -- one for pure C use, the other for use inside VMS or within applications written in a VMS-based language (IE, inside a top-level function or a call descendant of a top-level function) -- but only when the VMS is the "MC_shared" version. + +The reason is that VMS that uses shared memory on multicores moves the SlaveVPs around among cores. But, the libC and glibC malloc stores info at the top of the stack (a "clever" hack), for a speed improvement. So, when VMS manipulates the stack pointer, and/or moves Slaves to different cores, the "free" seg faults (that was FUN to figure out ; ) So, this version of VMS implements its own malloc. \ No newline at end of file