|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * IDENTIFICATION
|
10 |
| - * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.3 1996/11/06 10:32:10 scrappy Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.4 1997/05/20 11:35:50 vadim Exp $ |
11 | 11 | *
|
12 | 12 | * NOTES
|
13 | 13 | *Sorts the first relation into the second relation. The sort may
|
@@ -175,7 +175,7 @@ resetpsort()
|
175 | 175 | fwrite((char *)TUP, (TUP)->t_len, 1, FP)
|
176 | 176 | #defineENDRUN(FP)fwrite((char *)&shortzero, sizeof (shortzero), 1, FP)
|
177 | 177 | #defineGETLEN(LEN,FP)fread((char *)&(LEN), sizeof (shortzero), 1, FP)
|
178 |
| -#defineALLOCTUP(LEN)((HeapTuple)malloc((unsigned)LEN)) |
| 178 | +#defineALLOCTUP(LEN)((HeapTuple)palloc((unsigned)LEN)) |
179 | 179 | #defineGETTUP(TUP,LEN,FP)\
|
180 | 180 | IncrProcessed(); \
|
181 | 181 | BytesRead += (LEN) - sizeof (shortzero); \
|
@@ -349,7 +349,7 @@ tuplecopy(HeapTuple tup, Relation rdesc, Buffer b)
|
349 | 349 | if (!HeapTupleIsValid(tup)) {
|
350 | 350 | return(NULL);/* just in case */
|
351 | 351 | }
|
352 |
| -rettup= (HeapTuple)malloc(tup->t_len); |
| 352 | +rettup= (HeapTuple)palloc(tup->t_len); |
353 | 353 | memmove((char*)rettup, (char*)tup,tup->t_len);/* XXX */
|
354 | 354 | return(rettup);
|
355 | 355 | }
|
@@ -527,13 +527,13 @@ gettape()
|
527 | 527 | staticinttapeinit=0;
|
528 | 528 | char*mktemp();
|
529 | 529 |
|
530 |
| -tp= (structtapelst*)malloc((unsigned)sizeof (structtapelst)); |
| 530 | +tp= (structtapelst*)palloc((unsigned)sizeof (structtapelst)); |
531 | 531 | if (!tapeinit) {
|
532 | 532 | Tempfile[sizeof (TEMPDIR)-1]='/';
|
533 | 533 | memmove(Tempfile+sizeof(TEMPDIR),TAPEEXT,sizeof (TAPEEXT));
|
534 | 534 | tapeinit=1;
|
535 | 535 | }
|
536 |
| -tp->tl_name=malloc((unsigned)sizeof(Tempfile)); |
| 536 | +tp->tl_name=palloc((unsigned)sizeof(Tempfile)); |
537 | 537 | /*
|
538 | 538 | * now, copy template with final null into malloc'd space
|
539 | 539 | */
|
|