Dev Shed Forums - C Programming http://forums.devshed.com/ C programming forum discussing all C derivatives, including C#, C++, Object-C, and even plain old vanilla C. These languages are low level languages, and used on projects such as device drivers, compilers, and even whole computer operating systems. You can also talk about C# implementation in our .NET section below, when applicable. en Thu, 17 Jan 2019 08:08:03 GMT vBulletin 60 http://forums.devshed.com/images/misc/rss.png Dev Shed Forums - C Programming http://forums.devshed.com/ Please explain the process_memory_counters parameters http://forums.devshed.com/programming/981296-please-explain-process_memory_counters-parameters-new-post.html Tue, 15 Jan 2019 13:34:26 GMT From what I have managed to google of it the working set refers to how much ram it's using and the pagefile refers to how much it has reserved, unfortunately that's the most I could infer from what I could get a hold of, the sites, threads & comments never seem to explain beyond the working set and saying that it equates to the residential memory in linux etc.
All I'd like to know is what is the non-jargon or at least reduced jargon explaination for ALL the parameters (except cb, I don't understand why M$ felt the need to add that twice, on the struct and the function that fills it)

Edit: The best I could come up with to understand it myself is this:
Code:

typedef struct memcount {
        size_t size;
        size_t peak;
} memcount_t;
typedef struct memusage {
        size_t theory; /* Fantasy limit of memory */
        size_t faults; /* Page Faults */
        memcount_t physical; /* RSS / Working */
        memcount_t reserved; /* VSZ / Pagefile */
        memcount_t nowusing; /* Paged */
        memcount_t hovering; /* Not Paged */
} memusage_t;

]]>
C Programming zxuiji http://forums.devshed.com/programming-42/please-explain-process_memory_counters-parameters-981296.html
Problems Compiling http://forums.devshed.com/programming/981290-compiling-new-post.html Fri, 11 Jan 2019 11:30:18 GMT set FLAGS=-Wall -mconsole -mwindows -mwin32 -D _WIN32 Compiling Lake Object O:\Data\C_Playground\lake>mingw32-gcc -Wall -mconsole...]]> I can compile my objects fine (unless I try MinGW64) but the executable won't compile, here's an edited version of my output:
Code:

"O:\Data\C_Playground\lake\build.bat" (in directory: O:\Data\C_Playground\lake)
...
O:\Data\C_Playground\lake>set FLAGS=-Wall -mconsole -mwindows -mwin32 -D _WIN32
Compiling Lake Object
O:\Data\C_Playground\lake>mingw32-gcc -Wall -mconsole -mwindows -mwin32 -D _WIN32 -o ".\obj32\lake.c.o" -c .\lake.c
Compiling Lua Objects
O:\Data\C_Playground\lake>mingw32-gcc -Wall -mconsole -mwindows -mwin32 -D _WIN32 -o ".\obj32\lua\ldblib.c.o" -c "O:\Common\lua-5.3.5\src\ldblib.c"
...
Compiling Lake Executable
O:\Data\C_Playground\lake>mingw32-gcc -Wall -mconsole -mwindows -mwin32 -D _WIN32 -fPIC -o "O:\Common\lake32\lake32.exe"  ...
collect2.exe: error: ld returned 5 exit status
PATH=O:\Common\MinGW\bin;X:\PortableApps\GeanyPortable\App\Geany\bin;X:\PortableApps\GeanyPortable\App\Geany\bin;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;A:\Tools\WinSDK\10\Windows Performance Toolkit\;C:\Users\awsde_000\AppData\Local\Microsoft\WindowsApps;
CPATH=O:\Common\MinGW\bin;X:\PortableApps\GeanyPortable\App\Geany\bin;X:\PortableApps\GeanyPortable\App\Geany\bin;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;A:\Tools\WinSDK\10\Windows Performance Toolkit\;C:\Users\awsde_000\AppData\Local\Microsoft\WindowsApps;
LIBRARY_PATH=O:\Common\MinGW
O:\Data\C_Playground\lake>exit
Compilation failed.

]]>
C Programming zxuiji http://forums.devshed.com/programming-42/compiling-981290.html
<![CDATA[Sorting List<T> inside variant type method]]> http://forums.devshed.com/programming/981277-sorting-list-inside-variant-type-method-new-post.html Fri, 04 Jan 2019 21:25:10 GMT Good evening together!

Currently I'm playing around a little bit with C# and I can't figure out a little gotcha.

What I'm trying to do is to write a method to group and aggregate a given list, using a lamba function, one for sorting and another to to the aggregation.

This is a sample code excerpt to explain:

Code:

using System;
using System.Collections.Generic;
                                       
public class GroupHelper
{
    public static IList<T> groupList<T>(List<T> lst, Comparison<T> cmp, Action<T,T> aggregate)
    {
        List<T> groupedList    = new List<T>();
        T      buffer        = default(T);
       
        lst.sort(cmp);

        foreach ( T currItem in lst )
        {
            if( buffer == null )
            {
                buffer=currItem;
                continue;   
            }
   
            if( cmp(buffer, currItem) == 0 )
            {
                aggregate(buffer, currItem);
                continue;
            }

            groupedList.add(buffer);
            buffer=currItem;
        }
        groupedList.add(buffer);
        return groupedList;
    }
}

Unfortunately the whole thing doesn't want to compile. Problems are reported for these three lines:

Code:

lst.sort(cmp);
and the two
Code:

groupedList.add(buffer);
The messages say, 'List<T>' would not contain a definition for 'sort' and 'add', but according to MSDN the indeed do.

My google skills are leaving me today and I can't say, I have much C# experience. Can anybody please point me into the right direction?

Relevant links would be appreciated, as well.

Thanks for any ideas and best regards,
Jens ]]>
C Programming JClasen http://forums.devshed.com/programming-42/sorting-list-inside-variant-type-method-981277.html