Changeset 3458 for trunk/src/kash/generated/nodes.c
- Timestamp:
- Sep 14, 2020, 11:46:32 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/generated/nodes.c
r3449 r3458 51 51 #include "shinstance.h" 52 52 53 #ifndef KASH_SEPARATE_PARSER_ALLOCATOR 53 54 54 55 size_t funcblocksize; /* size of structures in function */ … … 93 94 STATIC char *nodesavestr(char *); 94 95 96 #endif /* !KASH_SEPARATE_PARSER_ALLOCATOR */ 95 97 96 98 … … 104 106 union node *n; 105 107 { 108 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 109 if (n != NULL) { 110 unsigned refs = pstackretain(n->pblock); 111 TRACE2((psh, "copyfunc: %p - %u refs\n", n->pblock, refs)); K_NOREF(refs); 112 } 113 return n; 114 #else 106 115 if (n == NULL) 107 116 return NULL; … … 112 121 funcstring = (char *) funcblock + funcblocksize; 113 122 return copynode(n); 114 } 115 116 123 #endif 124 } 125 126 #ifndef KASH_SEPARATE_PARSER_ALLOCATOR 117 127 118 128 STATIC void … … 274 284 case NAPPEND: 275 285 new->nfile.fname = copynode(n->nfile.fname); 286 new->nfile.next = copynode(n->nfile.next); 276 287 new->nfile.fd = n->nfile.fd; 277 new->nfile.next = copynode(n->nfile.next);278 288 break; 279 289 case NTOFD: … … 281 291 new->ndup.vname = copynode(n->ndup.vname); 282 292 new->ndup.dupfd = n->ndup.dupfd; 293 new->ndup.next = copynode(n->ndup.next); 283 294 new->ndup.fd = n->ndup.fd; 284 new->ndup.next = copynode(n->ndup.next);285 295 break; 286 296 case NHERE: 287 297 case NXHERE: 288 298 new->nhere.doc = copynode(n->nhere.doc); 299 new->nhere.next = copynode(n->nhere.next); 289 300 new->nhere.fd = n->nhere.fd; 290 new->nhere.next = copynode(n->nhere.next);291 301 break; 292 302 case NNOT: … … 335 345 } 336 346 347 #endif /* !KASH_SEPARATE_PARSER_ALLOCATOR */ 337 348 338 349 … … 343 354 void 344 355 freefunc(psh, n) 345 shinstance *psh;356 shinstance *psh; 346 357 union node *n; 347 358 { 359 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR 360 if (n) 361 pstackrelease(psh, n->pblock, "freefunc"); 362 #else 348 363 if (n) 349 364 ckfree(psh, n); 350 } 365 #endif 366 }
Note:
See TracChangeset
for help on using the changeset viewer.