[ 
http://issues.apache.org/jira/browse/XERCESC-1428?page=comments#action_66584 ]
     
James Berry commented on XERCESC-1428:
--------------------------------------

Hey Axel,

I can't get that patch to apply. Any thoughts?

% curl 
"http://issues.apache.org/jira/secure/attachment/20316/transcoder-179120.diff"; 
| patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7926  100  7926    0     0   9171      0 --:--:-- --:--:-- --:--:-- 15147
patching file src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp
patch: **** malformed patch at line 65:  char* 
IconvLCPTranscoder::transcode(const XMLCh* const toTranscode,


James

> new iconv-transcoder algorithm
> ------------------------------
>
>          Key: XERCESC-1428
>          URL: http://issues.apache.org/jira/browse/XERCESC-1428
>      Project: Xerces-C++
>         Type: Improvement
>   Components: Utilities
>  Environment: linux
>     Reporter: Axel Weiss
>     Priority: Minor
>  Attachments: transcoder-179120.diff
>
> James Berry wrote:
> > What if you make this initial buffer a static buffer? And allocate  
> > the exact size needed at the end?
> > That keeps the memory cost constant, at the expense of a guaranteed  
> > extra string copy.
> >
> > For cases where you exceed the static buffer size, continue to do  
> > your size-doubling on overflow; for the cases where you exceed the  
> > static buffer size, you'll continue to use excess memory.
> >
> > I think this tradeoff would be worth it...
> Ok, it now starts with a local buffer on the stack and creates a copy with 
> the exact size needed, if this buffer was not exceeded. Otherwise, an always 
> doubling buffer enlargement is performed, resulting in returning an excess 
> buffer for the result.
> The patch is against 3.0-unstable-179120.
>                  Axel

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to