Avoid a lot of malloc/free traffic

Each console write caused temporary buffer allocation.

Avoid allocations by changing console_draw_str() to use Forth
string parameters, which are usually readily available.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@872 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2010-09-29 20:30:51 +00:00
parent 9db24694ca
commit b60891b683
9 changed files with 15 additions and 34 deletions

View File

@@ -35,16 +35,10 @@ stdout_write( void )
{
int len = POP();
char *addr = (char*)POP();
char *s = malloc( len + 1 );
strncpy_nopad( s, addr, len );
s[len]=0;
printk( "%s", s );
//vfd_draw_str( s );
console_draw_str( s );
free( s );
console_draw_fstr(addr, len);
PUSH( len );
}