5 Commits

Author SHA1 Message Date
Kawe Mazidjatari
f67d8e87b1 Tier1: use template index type for memory allocation
For CUtl* classes: use the index type rather than just ssize_t, this will throw compile warnings for code that constructs a CUtl* object allocating more memory than the index type allows (e.g. allocating UINT16_MAX while the index type has been set to UINT8_MAX).
2024-04-05 18:27:09 +02:00
Kawe Mazidjatari
c42ebe2cfc Tier1: use correct index types for template classes
This ensures that we can never allocate more memory than the maximum value that type could hold, without triggering a compile warning. There was a mention about shorts being slow on PowerPC platforms for utllinkedlist, but the index local type could be overridden (defaults to index storage type). In case it gets used for PowerPC, use 32bit ints as index local types; as the local type gets used for arithmetic operations while storage type is what's getting cached off in memory. This patch had no effect on generated output code, it was mostly implemented to avoid future problems.
2024-04-05 17:56:54 +02:00
Kawe Mazidjatari
ea8074dff9 Fix bug in utllinkedlist
Should return template type (default 'unsigned short') instead of int as Count.
2024-04-05 16:34:30 +02:00
Kawe Mazidjatari
ae52aa0081 Replace memalloc calls for Valve container types
Utilize new malloc system using the conventional approach, see commit 708a2495.
2023-06-26 21:18:44 +02:00
Kawe Mazidjatari
9f428f1567 Move tier0 lib headers to public
This commit does not change any logic or behavior of the code.
2023-04-06 23:50:48 +02:00