> 64k Strings Hack - Does it work or not?
no, it would stop 99.9% of the complaints 
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
hahahaha
TRUE!
TRUE!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Yea - that's just the kind of thing I was afraid of...
Ohhhh Freddy Fred... Do you consider that a bug?
Ohhhh Freddy Fred... Do you consider that a bug?
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Raising the limit is imho not neccesary.
Most program do not even need 64k of string length (i only hit that limit
once, through a bug in my program
), so why waste the memory like
that?
If you just want to write a little tool, that displays one or two words in it's
gui, you don't want it to use 10 megs of ram because of that.
Timo
Most program do not even need 64k of string length (i only hit that limit
once, through a bug in my program
that?
If you just want to write a little tool, that displays one or two words in it's
gui, you don't want it to use 10 megs of ram because of that.
Timo
quidquid Latine dictum sit altum videtur
...,
Indieed most of the time allcatememory is good enough to load a full file in memory, parse it, and free it after keeping the part you need.
I do not consider long strings as a real requirement, as a bypass exists, and when we, all programers I mean, use strings, it is most of the time to parse lines. And lines are not so much often long enough.
Maybe one good Purebasic's add would be to create a 'regular' library to have an alternative to FindString and StringField Purebasic commands for long strings.
Well ... on my own I actually use the 'string equivalence' tip I have :
This makes possible to request either a string part using String variable or
to evaluate a single byte.
This is very fast and useful.
Indieed most of the time allcatememory is good enough to load a full file in memory, parse it, and free it after keeping the part you need.
I do not consider long strings as a real requirement, as a bypass exists, and when we, all programers I mean, use strings, it is most of the time to parse lines. And lines are not so much often long enough.
Maybe one good Purebasic's add would be to create a 'regular' library to have an alternative to FindString and StringField Purebasic commands for long strings.
Well ... on my own I actually use the 'string equivalence' tip I have :
Code: Select all
Structure StringBytes
Bytes.b[64000]
EndStructure
String.s = "whatever you want"
*MyString1.StringBytes = @String ; PokeB(@String, PeekS(@String))
Code: Select all
*MyString\Bytes[index]
This is very fast and useful.
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
Ok, I'm back to being confused again.freak wrote:Raising the limit is imho not neccesary.
Most program do not even need 64k of string length (i only hit that limit
once, through a bug in my program), so why waste the memory like
that?
If you just want to write a little tool, that displays one or two words in it's
gui, you don't want it to use 10 megs of ram because of that.
Timo
How would raising the possible upper limit of strings cause more memory to be used? It's already been said (and I've assumed said correctly) that you only see more memory usage if you actually use the space. So a 10k string still only takes 10k of memory - even if it's *possible* to write 5 megs of data into that same string..
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Ok, now that fr34k smacked me around a little bit on IRC I get it...

But...
Gotcha... Thanks to everyone!
It will only allocate that buffer once, but it still allocates it. So increasing the limit to 10 megs would mean that a one time allocation of 10 megs of memory would be made when your exe starts upbecause PB always allocates a fixed buffer for string manipulation
But...
... so there is hope yet (at least for we single platform developers).<fr34k> Windows does that kind of smart though.. if you request a 100mb buffer and only use the first 10 byte, it will only allocate 10 byte, and increase that buffer if you need more. Other OS don't do that though
Gotcha... Thanks to everyone!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Karbon,
If you check it with the code I posted @ viewtopic.php?t=10760, you will see that only used string is consumed, but it does not mean exactly this byte to byte as paging using W32 is 64K based AFAIK.
Rgrds
If you check it with the code I posted @ viewtopic.php?t=10760, you will see that only used string is consumed, but it does not mean exactly this byte to byte as paging using W32 is 64K based AFAIK.
Rgrds
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.


