tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] tcc_relocate() and tcc_relocate_ex()


From: Sean Conner
Subject: Re: [Tinycc-devel] tcc_relocate() and tcc_relocate_ex()
Date: Thu, 30 Aug 2012 17:46:47 -0400
User-agent: Mutt/1.4.1i

It was thus said that the Great grischka once stated:
> Sean Conner wrote:
> >  I do not like this idea, and here's why:  it produces a function that 
> >  does
> >two different things depending upon one parameter:
> 
> Count.  It is three different things.
> 
> >     In both cases, it returns the number of bytes required to relocate
> >     the code.
> 
> No.

  No?  It doesn't return the number of bytes required to relocate the code? 
Because my reading of tcc_relocate() seems to do just that to me.

> >  I can't stand functions that do more than one thing for no real good
> >reason.  
> 
> So being serious, you need
>   - tcc_relocate
>   - tcc_relocate_size
>   - tcc_relocate_copy
> 
> which then are three functions that do almost the same thing.

  Technically, you are correct, but I have seen the "pass NULL to get the
size required to allocate" approach elsewhere.  It doesn't quite sit well
with me, but I can accept that approach.

  -spc 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]