Changeset 2056 in kBuild
- Timestamp:
- Nov 4, 2008 3:25:19 AM (17 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/Makefile.kmk
r2024 r2056 172 172 CONFIG_WITH_RDONLY_VARIABLE_VALUE \ 173 173 CONFIG_WITH_LAZY_DEPS_VARS \ 174 CONFIG_WITH_MEMORY_OPTIMIZATIONS \ 174 175 \ 175 176 KBUILD_HOST=\"$(KBUILD_TARGET)\" \ -
trunk/src/kmk/commands.h
r2024 r2056 33 33 int any_recurse; /* Nonzero if any `lines_recurse' elt has */ 34 34 /* the COMMANDS_RECURSE bit set. */ 35 #ifdef CONFIG_WITH_MEMORY_OPTIMIZATIONS 36 int refs; /* References. */ 37 #endif 35 38 }; 36 39 -
trunk/src/kmk/default.c
r1993 r2056 584 584 if (f->cmds == 0) 585 585 { 586 #ifndef CONFIG_WITH_ALLOC_CACHES 586 587 f->cmds = xmalloc (sizeof (struct commands)); 588 #else 589 f->cmds = alloccache_alloc (&commands_cache); 590 #endif 587 591 f->cmds->fileinfo.filenm = 0; 588 592 f->cmds->commands = s[1]; 589 593 f->cmds->command_lines = 0; 594 #ifdef CONFIG_WITH_MEMORY_OPTIMIZATIONS 595 f->cmds->refs = 1000; 596 #endif 590 597 } 591 598 } -
trunk/src/kmk/job.c
r2001 r2056 944 944 } 945 945 946 #ifdef CONFIG_WITH_MEMORY_OPTIMIZATIONS 947 /* Free the chopped command lines for simple targets when 948 there are no more active references to them. */ 949 950 child->file->cmds->refs--; 951 if ( !child->file->intermediate 952 && !child->file->pat_variables 953 && child->file->cmds->refs == 0) 954 { 955 struct commands *cmds = child->file->cmds; 956 unsigned int i; 957 958 for (i = 0; i < cmds->ncommand_lines; ++i) 959 { 960 free (cmds->command_lines[i]); 961 cmds->command_lines[i] = 0; 962 } 963 free (cmds->command_lines); 964 cmds->command_lines = 0; 965 free (cmds->lines_flags); 966 cmds->lines_flags = 0; 967 cmds->ncommand_lines = 0; 968 } 969 #endif /* CONFIG_WITH_MEMORY_OPTIMIZATIONS */ 970 946 971 free (child); 947 972 } … … 1682 1707 /* Chop the commands up into lines if they aren't already. */ 1683 1708 chop_commands (cmds); 1709 #ifdef CONFIG_WITH_MEMORY_OPTIMIZATIONS 1710 cmds->refs++; /* retain the chopped lines. */ 1711 #endif 1684 1712 1685 1713 /* Expand the command lines and store the results in LINES. */ -
trunk/src/kmk/read.c
r2041 r2056 2540 2540 cmds->commands = savestring (commands, commands_idx); 2541 2541 cmds->command_lines = 0; 2542 #ifdef CONFIG_WITH_MEMORY_OPTIMIZATIONS 2543 cmds->refs = 0; 2544 #endif 2542 2545 } 2543 2546 else -
trunk/src/kmk/rule.c
r1993 r2056 404 404 r->cmds->commands = xstrdup (p->commands); 405 405 r->cmds->command_lines = 0; 406 #ifdef CONFIG_WITH_MEMORY_OPTIMIZATIONS 407 r->cmds->refs = 1000; 408 #endif 406 409 } 407 410 } … … 489 492 if (new_pattern_rule (r, override)) 490 493 r->terminal = terminal; 494 #ifdef CONFIG_WITH_MEMORY_OPTIMIZATIONS 495 commands->refs = 1000; 496 #endif 491 497 } 492 498
Note:
See TracChangeset
for help on using the changeset viewer.