Hi! ----
Attached (as "astksh20130503_purge_newof_part001.diff.gz") is a small
cleanup patch which replaces |newof()| usage with |oldof()| (same as
|newof()| but uses |malloc()| instead of |calloc()|) ...
... notes:
** The patch is tested since a new weeks... the only change I consider
"risky" is the one in src/lib/libast/misc/stk.c ... I'm not sure
whether other sfio consumers can trip over this or not:
-- snip --
diff -r -u original/src/lib/libast/misc/stk.c
build_i386_64bit_debug/src/lib/libast/misc/stk.c
--- src/lib/libast/misc/stk.c 2012-05-18 08:48:45.000000000 +0200
+++ src/lib/libast/misc/stk.c 2013-05-05 01:24:05.531657541 +0200
@@ -521,7 +521,7 @@
end = fp->end;
}
endoff = end - dp;
- cp = newof(dp, char, n, nn*sizeof(char*));
+ cp = oldof(dp, char, n, nn*sizeof(char*));
if(!cp && (!sp->stkoverflow || !(cp = (*sp->stkoverflow)(n))))
return(0);
increment(grow);
-- snip --
** the patch introduces a new CPP symbol called |AST_PROFILE_NEWOF|
... please keep this "knob" so later cleanup related to
|newof()|/|oldof()| becomes a bit easier.
** the patch does some other minor cleanup, e.g. |e_space| instead of
using plain literals with the same value around
** the patch is mainly a "demo" what could be done (a full purge will
need a lot more patches+testing) and was done by tackling those
|newof()| consumers which are used in loops at startup+when large
enums are used
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) [email protected]
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
astksh20130503_purge_newof_part001.diff.gz
Description: GNU Zip compressed data
_______________________________________________ ast-developers mailing list [email protected] http://lists.research.att.com/mailman/listinfo/ast-developers
