git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] test-drop-caches: mark file local symbols with static

From
Ben Peart <peartben@gmail.com>
Date
Sep 18, 2017, 12:32 UTC
Message-ID
<756cf0ba-aad8-3fdb-298a-f174394e5895@gmail.com>
In-Reply-To
<762d317b-8174-1809-a077-38b036850d3f@ramsayjones.plus.com>
On 9/17/2017 12:14 PM, Ramsay Jones wrote:
Show 9 quoted lines
> 
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
> 
> Hi Ben,
> 
> If you need to re-roll your 'bp/fsmonitor' branch, could you please
> squash this into the relevant patch (commit c6b5a28941, "fsmonitor:
> add a performance test", 15-09-2017).
Absolutely.  Thanks!

I'd really appreciate some feedback on whether this works properly on platform other than Windows.

Show 84 quoted lines
> 
> Thanks!
> 
> ATB,
> Ramsay Jones
> 
>   t/helper/test-drop-caches.c | 18 +++++++++---------
>   1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/t/helper/test-drop-caches.c b/t/helper/test-drop-caches.c
> index 717079865..17590170f 100644
> --- a/t/helper/test-drop-caches.c
> +++ b/t/helper/test-drop-caches.c
> @@ -2,7 +2,7 @@
>   
>   #if defined(GIT_WINDOWS_NATIVE)
>   
> -int cmd_sync(void)
> +static int cmd_sync(void)
>   {
>   	char Buffer[MAX_PATH];
>   	DWORD dwRet;
> @@ -49,7 +49,7 @@ typedef enum _SYSTEM_MEMORY_LIST_COMMAND {
>   	MemoryCommandMax
>   } SYSTEM_MEMORY_LIST_COMMAND;
>   
> -BOOL GetPrivilege(HANDLE TokenHandle, LPCSTR lpName, int flags)
> +static BOOL GetPrivilege(HANDLE TokenHandle, LPCSTR lpName, int flags)
>   {
>   	BOOL bResult;
>   	DWORD dwBufferLength;
> @@ -77,7 +77,7 @@ BOOL GetPrivilege(HANDLE TokenHandle, LPCSTR lpName, int flags)
>   	return bResult;
>   }
>   
> -int cmd_dropcaches(void)
> +static int cmd_dropcaches(void)
>   {
>   	HANDLE hProcess = GetCurrentProcess();
>   	HANDLE hToken;
> @@ -118,36 +118,36 @@ int cmd_dropcaches(void)
>   
>   #elif defined(__linux__)
>   
> -int cmd_sync(void)
> +static int cmd_sync(void)
>   {
>   	return system("sync");
>   }
>   
> -int cmd_dropcaches(void)
> +static int cmd_dropcaches(void)
>   {
>   	return system("echo 3 | sudo tee /proc/sys/vm/drop_caches");
>   }
>   
>   #elif defined(__APPLE__)
>   
> -int cmd_sync(void)
> +static int cmd_sync(void)
>   {
>   	return system("sync");
>   }
>   
> -int cmd_dropcaches(void)
> +static int cmd_dropcaches(void)
>   {
>   	return system("sudo purge");
>   }
>   
>   #else
>   
> -int cmd_sync(void)
> +static int cmd_sync(void)
>   {
>   	return 0;
>   }
>   
> -int cmd_dropcaches(void)
> +static int cmd_dropcaches(void)
>   {
>   	return error("drop caches not implemented on this platform");
>   }
> 
Previous: Ramsay Jones
Message 2 of 2 in “test-drop-caches: mark file local symbols with static”
  1. test-drop-caches: mark file local symbols with staticRamsay Jones, Sep 17, 2017
  2. Ben PeartSep 18, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.