Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update l4d2 #85

Open
wants to merge 24 commits into
base: l4d2
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add mallocsize
arthurdead committed Mar 31, 2021
commit 74bf01cc77ffcdee8ef66fcedeca8b0287af9b9f
12 changes: 12 additions & 0 deletions public/tier0/platform.h
Original file line number Diff line number Diff line change
@@ -423,6 +423,18 @@ typedef void * HINSTANCE;
#define stackfree( _p )
#endif

#if defined( GNUC )
#ifdef _LINUX
#define mallocsize( _p ) ( malloc_usable_size( _p ) )
#elif defined(OSX)
#define mallocsize( _p ) ( malloc_size( _p ) )
#else
#error
#endif
#elif defined ( _WIN32 )
#define mallocsize( _p ) ( _msize( _p ) )
#endif

#ifdef _WIN32
#define RESTRICT __restrict
#define RESTRICT_FUNC __declspec(restrict)