Changeset: 6c1d3bae9fb1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6c1d3bae9fb1
Modified Files:
geom/monetdb5/geom.c
geom/monetdb5/geom_atoms.c
monetdb5/mal/mal_client.c
monetdb5/mal/mal_client.h
monetdb5/mal/mal_profiler.c
monetdb5/mal/mal_session.c
monetdb5/modules/mal/clients.c
Branch: resource_management
Log Message:
use consistant naming for allocator
diffs (truncated from 611 to 300 lines):
diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -53,7 +53,7 @@ GEOSGeom_getCollectionType (int GEOSGeom
str
wkbCollectAggrSubGroupedCand(Client ctx, bat *outid, const bat *bid, const bat
*gid, const bat *eid, const bat *sid, const bit *skip_nils)
{
- allocator *ma = ctx->alloc;
+ allocator *ma = ctx->ma;
assert(ma);
BAT *b = NULL, *g = NULL, *s = NULL, *out = NULL;
BAT *sortedgroups, *sortedorder;
@@ -236,7 +236,7 @@ wkbCollectAggrSubGrouped(Client ctx, bat
str
wkbCollectAggr(Client ctx, wkb **out, const bat *bid) {
- allocator *ma = ctx->alloc;
+ allocator *ma = ctx->ma;
assert(ma);
str msg = MAL_SUCCEED;
BAT *b = NULL;
@@ -686,7 +686,7 @@ wkbTransform(Client ctx, wkb **transform
is_int_nil(*srid_dst) ||
strNil(*proj4_src_str) ||
strNil(*proj4_dst_str)) {
- if ((*transformedWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*transformedWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.Transform", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -696,7 +696,7 @@ wkbTransform(Client ctx, wkb **transform
if (strcmp(*proj4_dst_str, "null") == 0)
throw(MAL, "geom.Transform", SQLSTATE(38000) "Cannot find in
spatial_ref_sys srid %d\n", *srid_dst);
if (strcmp(*proj4_src_str, *proj4_dst_str) == 0) {
- if ((*transformedWKB = wkbCopy(ctx->alloc, *geomWKB)) == NULL)
+ if ((*transformedWKB = wkbCopy(ctx->ma, *geomWKB)) == NULL)
throw(MAL, "geom.Transform", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -1046,7 +1046,7 @@ wkbForceDim(Client ctx, wkb **outWKB, wk
str err;
if (is_wkb_nil(*geomWKB) || is_int_nil(*dim)) {
- if ((*outWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*outWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.ForceDim", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -1433,7 +1433,7 @@ wkbSegmentize(Client ctx, wkb **outWKB,
str err;
if (is_wkb_nil(*geomWKB) || is_dbl_nil(*sz)) {
- if ((*outWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*outWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.Segmentize", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -1756,7 +1756,7 @@ wkbTranslate(Client ctx, wkb **outWKB, w
str err;
if (is_wkb_nil(*geomWKB) || is_dbl_nil(*dx) || is_dbl_nil(*dy) ||
is_dbl_nil(*dz)) {
- if ((*outWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*outWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.Translate", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -1797,7 +1797,7 @@ wkbDelaunayTriangles(Client ctx, wkb **o
GEOSGeom geosGeometry;
if (is_wkb_nil(*geomWKB) || is_dbl_nil(*tolerance) ||
is_int_nil(*flag)) {
- if ((*outWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*outWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.DelaunayTriangles", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -1826,7 +1826,7 @@ wkbPointOnSurface(Client ctx, wkb **resW
GEOSGeom geosGeometry, resGeosGeometry;
if (is_wkb_nil(*geomWKB)) {
- if ((*resWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*resWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.PointOnSurface", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -2300,7 +2300,7 @@ geom_2_geom(Client ctx, wkb **resWKB, wk
int valueSRID = (*valueWKB)->srid;
if (is_wkb_nil(*valueWKB) || is_int_nil(*columnType) ||
is_int_nil(*columnSRID)) {
- *resWKB = wkbNULLcopy(ctx->alloc);
+ *resWKB = wkbNULLcopy(ctx->ma);
if (*resWKB == NULL)
throw(MAL, "calc.wkb", SQLSTATE(HY013) MAL_MALLOC_FAIL);
return MAL_SUCCEED;
@@ -2370,7 +2370,7 @@ geoHasM(Client ctx, int *res, int *info)
str
geoGetType(Client ctx, char **res, int *info, int *flag)
{
- allocator *ma = ctx->alloc;
+ allocator *ma = ctx->ma;
assert(ma);
if (is_int_nil(*info) || is_int_nil(*flag)) {
if ((*res = MA_STRDUP(ma, str_nil)) == NULL)
@@ -2516,7 +2516,7 @@ static char hexit[] = "0123456789ABCDEF"
str
wkbAsBinary(Client ctx, char **toStr, wkb **geomWKB)
{
- allocator *ma = ctx->alloc;
+ allocator *ma = ctx->ma;
assert(ma);
char *s;
int i;
@@ -2591,13 +2591,13 @@ decit(char hex)
str
wkbFromBinary(Client ctx, wkb **geomWKB, const char **inStr)
{
- allocator *ma = ctx? ctx->alloc : MT_thread_getallocator();
+ allocator *ma = ctx? ctx->ma : MT_thread_getallocator();
assert(ma);
size_t strLength, wkbLength, i;
wkb *w;
if (strNil(*inStr)) {
- if ((*geomWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*geomWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.FromBinary", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -2634,7 +2634,7 @@ wkbFromBinary(Client ctx, wkb **geomWKB,
str
mbrFromMBR(Client ctx, mbr **w, mbr **src)
{
- allocator *ma = ctx->alloc;
+ allocator *ma = ctx->ma;
assert(ma);
*w = ma_alloc(ma, sizeof(mbr));
if (*w == NULL)
@@ -2647,7 +2647,7 @@ mbrFromMBR(Client ctx, mbr **w, mbr **sr
str
wkbFromWKB(Client ctx, wkb **w, wkb **src)
{
- allocator *ma = ctx->alloc;
+ allocator *ma = ctx->ma;
assert(ma);
*w = ma_alloc(ma, wkb_size((*src)->len));
if (*w == NULL)
@@ -2677,7 +2677,7 @@ wkbFromText(Client ctx, wkb **geomWKB, s
*geomWKB = NULL;
if (strNil(*geomWKT) || is_int_nil(*srid) || is_int_nil(*tpe)) {
- if ((*geomWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*geomWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "wkb.FromText", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -2704,7 +2704,7 @@ wkbFromText(Client ctx, wkb **geomWKB, s
str
wkbAsText(Client ctx, char **txt, wkb **geomWKB, int *withSRID)
{
- allocator *ma = ctx->alloc;
+ allocator *ma = ctx->ma;
assert(ma);
size_t len = 0;
char *wkt = NULL;
@@ -2744,7 +2744,7 @@ wkbAsText(Client ctx, char **txt, wkb **
str
wkbMLineStringToPolygon(Client ctx, wkb **geomWKB, str *geomWKT, int *srid,
int *flag)
{
- allocator *ma = ctx->alloc;
+ allocator *ma = ctx->ma;
assert(ma);
int itemsNum = 0, i, type = wkbMultiLineString_mdb;
str ret = MAL_SUCCEED;
@@ -2755,7 +2755,7 @@ wkbMLineStringToPolygon(Client ctx, wkb
bit ordered = 0;
if (strNil(*geomWKT) || is_int_nil(*srid) || is_int_nil(*flag)) {
- if ((*geomWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*geomWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.MLineStringToPolygon", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -2946,7 +2946,7 @@ wkbMakePoint(Client ctx, wkb **out, dbl
GEOSCoordSeq seq;
if (is_dbl_nil(*x) || is_dbl_nil(*y) || is_dbl_nil(*z) ||
is_dbl_nil(*m) || is_int_nil(*zmFlag)) {
- if ((*out = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*out = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.MakePoint", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -3072,7 +3072,7 @@ wkbSetSRID(Client ctx, wkb **resultGeomW
GEOSGeom geosGeometry;
if (is_wkb_nil(*geomWKB) || is_int_nil(*srid)) {
- if ((*resultGeomWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*resultGeomWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.setSRID", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -3190,7 +3190,7 @@ wkbEnvelopeFromCoordinates(Client ctx, w
GEOSCoordSeq coordSeq;
if (is_dbl_nil(*xmin) || is_dbl_nil(*ymin) || is_dbl_nil(*xmax) ||
is_dbl_nil(*ymax) || is_int_nil(*srid)) {
- if ((*out = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*out = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.MakeEnvelope", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -3246,7 +3246,7 @@ wkbMakePolygon(Client ctx, wkb **out, wk
str err;
if (is_wkb_nil(*external) || is_int_nil(*srid)) {
- if ((*out = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*out = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.Polygon", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -3321,7 +3321,7 @@ wkbMakeLine(Client ctx, wkb **out, wkb *
*out = NULL;
if (is_wkb_nil(*geom1WKB) || is_wkb_nil(*geom2WKB)) {
- if ((*out = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*out = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.MakeLine", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -3449,7 +3449,7 @@ wkbMakeLineAggr(Client ctx, wkb **outWKB
* two rows? --sjoerd */
if (BATcount(inBAT) == 0) {
BBPunfix(inBAT->batCacheid);
- if ((*outWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*outWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.MakeLine", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -3520,7 +3520,7 @@ wkbMakeLineAggrArray(Client ctx, wkb **o
/* TODO: what should be returned if the input is less than
* two rows? --sjoerd */
if (size == 0) {
- if ((*outWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*outWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "aggr.MakeLine", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -3564,7 +3564,7 @@ wkbMakeLineAggrArray(Client ctx, wkb **o
str
wkbMakeLineAggrSubGroupedCand(Client ctx, bat *outid, const bat *bid, const
bat *gid, const bat *eid, const bat *sid, const bit *skip_nils)
{
- allocator *ma = ctx->alloc;
+ allocator *ma = ctx->ma;
assert(ma);
BAT *b = NULL, *g = NULL, *s = NULL, *out = NULL;
BAT *sortedgroups, *sortedorder;
@@ -3933,7 +3933,7 @@ wkbPointN(Client ctx, wkb **out, wkb **g
str err = MAL_SUCCEED;
if (is_wkb_nil(*geom) || is_int_nil(*n)) {
- if ((*out = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*out = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.PointN", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -3985,7 +3985,7 @@ wkbExteriorRing(Client ctx, wkb **exteri
str err = MAL_SUCCEED;
if (is_wkb_nil(*geom)) {
- if ((*exteriorRingWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*exteriorRingWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.ExteriorRing", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -4029,7 +4029,7 @@ wkbInteriorRingN(Client ctx, wkb **inter
*interiorRingWKB = NULL;
if (is_wkb_nil(*geom) || is_int_nil(*ringNum)) {
- if ((*interiorRingWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*interiorRingWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.InteriorRingN", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -4057,7 +4057,7 @@ wkbInteriorRingN(Client ctx, wkb **inter
if (rN < *ringNum || *ringNum <= 0) {
GEOSGeom_destroy_r(geoshandle, geosGeometry);
//NOT AN ERROR throw(MAL, "geom.interiorRingN", SQLSTATE(38000)
"Geos operation GEOSGetInteriorRingN failed. Not enough interior rings");
- if ((*interiorRingWKB = wkbNULLcopy(ctx->alloc)) == NULL)
+ if ((*interiorRingWKB = wkbNULLcopy(ctx->ma)) == NULL)
throw(MAL, "geom.InteriorRingN", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
@@ -4285,7 +4285,7 @@ wkbIsValid(Client ctx, bit *out, wkb **g
str
wkbIsValidReason(Client ctx, char **reason, wkb **geomWKB)
{
- allocator *ma = ctx->alloc;
+ allocator *ma = ctx->ma;
assert(ma);
GEOSGeom geosGeometry;
char *GEOSReason = NULL;
@@ -4319,7 +4319,7 @@ wkbIsValidReason(Client ctx, char **reas
str
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]