Message board for the users of flat assembler.
> Main > String Objects in fASM
I'm making a String object dll thing in fasm.
It uses the VirtualAlloc api to make my String Obj structure
.ptr dd 1 ;pointer to a string buffer
.len dd 1 ;length of string
.mem dd 1 ; memory used in buffer blocks of 512bytes
.hash dd 4 ; 16 byte hash of my own creation
StrNew - returns ptr to created str structure in memory
StrAdd(str struct address,buffer ptr, buffer len)
- add a buffer of specified length to str obj
StrAddStr(str struct A address, str struct B address) - append B to A
StrUpdate(str struct address) - updates the hash
- I'm using an MMX optimized 4 to 16 byte expansion of the djb hash
SCopyMem(ptr1, ptr2, len) - copy ptr2's data to ptr1
-This is an MMX optimized mem copy
...more string functions Compare, Len, Find, Replace etc.
When this is done I'm thinking about making it a C++ lib with dll2lib or some other program and then making a C++ class to wrap the functions in. I want a high speed string manipulation tool.
Any comments, input would be appreciated.
IE 'This is a waste of time' 'Good/Bad idea because ...'
|15 Apr 2005, 03:36||
Are you using VirtualAlloc for each string object? That would seem wasteful, not only because of the 4kb allocation granularity, but also because of the 64kb alignment and inability to easily ReAlloc...
|15 Apr 2005, 07:44||
I guess "dd 1" = "rd 1", "dd 4" = "rd 4" and so on?
|15 Apr 2005, 11:02||
Yes Tommy I meant RD not DD
F0dder then what would you suggest? Using heap or a filemapping?
|15 Apr 2005, 19:55||
< Last Thread | Next Thread >
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.