public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: newlib@sourceware.org
Subject: Re: [PATCH][MSP430] MSP430: Define __BUFSIZ__ as 256 to prevent default of 1024 being used
Date: Thu, 20 Jul 2017 14:19:00 -0000	[thread overview]
Message-ID: <20170720141930.GB19395@calimero.vinschen.de> (raw)
In-Reply-To: <a3139646-1d62-1c2c-25f4-723113c6bcac@somniumtech.com>

[-- Attachment #1: Type: text/plain, Size: 1314 bytes --]

On Jul 19 19:01, Jozef Lawrynowicz wrote:
> Many MSP430 devices have a very small amount of RAM (the MSP430FR5969
> has 2kB). A simple "Hello World" printf program built for one of these
> devices will not execute properly as stack and heap collide before
> output is printed.
> About 1.5kB of heap is allocated to do the printf, but reducing
> __BUFSIZ__ to 256 brings this to around 750 bytes, and the hello world
> program comfortably executes on hardware.
> 
> Patch is attached.

> From 7ba27bcfe2fbbc66d07c7f85062d7050b6381fcb Mon Sep 17 00:00:00 2001
> From: Jozef Lawrynowicz <jozef.l@somniumtech.com>
> Date: Mon, 10 Jul 2017 17:19:00 +0000
> Subject: [PATCH] MSP430: Define __BUFSIZ__ as 256 to prevent default of 1024
>  being used
> 
> ---
>  newlib/libc/include/sys/config.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h
> index c536698..39f8384 100644
> --- a/newlib/libc/include/sys/config.h
> +++ b/newlib/libc/include/sys/config.h
> @@ -155,6 +155,7 @@
>  #define _REENT_SMALL
>  #endif
>  
> +#define __BUFSIZ__ 256
>  #define __SMALL_BITFIELDS
>  
>  #ifdef __MSP430X_LARGE__
> -- 
> 1.8.3.1
> 

Pushed.

Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2017-07-20 14:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19 18:01 Jozef Lawrynowicz
2017-07-20 14:19 ` Corinna Vinschen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170720141930.GB19395@calimero.vinschen.de \
    --to=vinschen@redhat.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).