News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Strings sorting

Started by Danesh, March 17, 2005, 12:29:15 AM

Previous topic - Next topic

Danesh

Hi again all,

I am looking for a well-optimized routine to sort an array of strings. In MASM32 library there are some routines which sorts but they have been designed particularly for number and not strings. I have heared something about a string library which has been written by Donkey. Does it support string sorting ? If yes, can anybody help to get it ?

I am also working to a link-list in memory. For allocating memory I can use HeapAlloc, VirtualAlloc or Malloc of MASM32 library. However allocated memory may be more than 4 MB, do I think I can not allocate it from the heap. I want to know does Malloc function allocates memory from heap ? Also, is it an efficient way to allocate large amounts of memory from the heap ?

Thanks,

Danesh


hutch--

Danesh,

Get the later version of MASM32 as it has some high speed string sort procedures. Note this much that to use them you must not pass a NULL pointer string to them as they are not dsigned to handle NULL pointers. this means that to load the array of string handles, you must test for NULL strings as you load tha array.

These have been successfully tested on a gigabyte of string data and work fine.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Danesh

Hi Hutch,

I have version 8.2 with the latest SP installed, does it have those functions ? Are they in MASM32 library functions ?

Thanks,

Danesh


hutch--

Danesh,

If you have the service pack for version 8.2, then look in the help file that came with it.


assort proc arr:DWORD,cnt:DWORD,rdi:DWORD    ; ascending version
dssort proc arr:DWORD,cnt:DWORD,rdi:DWORD    ; descending version


These two are hybrids, ypou can access the others in the MASM32 library that came with the service pack.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php