Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 21st February 2012, 22:40   #1  |  Link
maxxon
Registered User
 
maxxon's Avatar
 
Join Date: Jan 2012
Location: On the net
Posts: 76
Concatenation failure on 4096 byte boundries

This is an odd one that I found while profile testing some of my code:

Code:
global output__junk = BlankClip(height=0, width=0, length=0)
global output__filename = "output.log"
function output(string s)
{
    output__junk.WriteFileStart(output__filename, "s", append=true)
    return 1
}

a = "        " # 8 
b = a+a+a+a+a+a+a+a # 64
c = b+b+b+b+b+b+b+b # 512
d = c+c+c+c+c+c+c+b+b+b+b+b+b+b+a+a+a+a+a+a+a+"      " # 4094
d.strlen.string.output
e = d + " "
e.strlen.string.output
e.output
I've not put in the code to actually output the byte locations (requires too much of my libraries), but if you check it out with an editor, you'll find that the 3rd line outputted contains crap near the end of the string and the string length has increased by 2-4 characters rather than 1.

Must have something to do with your string allocation methods as this can happen on any 4096 byte boundary, though it doesn't always happen. It appears that certain even multiple cats can keep this from happening.


|\/|x
maxxon is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:29.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.